Spaces:
Runtime error
Runtime error
File size: 907 Bytes
2baf278 45072f1 ecbec84 2baf278 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import streamlit as st
from websearching import web_search
from llama_cpp_inf import run_inference_lcpp
def reply(query):
jsonstr = web_search(query)
results = run_inference_lcpp(jsonstr, query)
return results
st.set_page_config(page_title="SearchPhi", page_icon="🔎")
# Title of the web app
st.title("SearchPhi🔎")
st.subheader("With Gradio Client API :)")
st.text("Support this space at https://github.com/AstraBert/SearchPhi with a ⭐")
# Input text box for the search query
query = st.text_input("Enter search term:")
# Number of results to display
num_results = st.number_input("Number of results to display:", min_value=1, max_value=5, value=3)
# Button to initiate search
if st.button("Search"):
if query:
results = reply(query)
st.write(f"**Results for '{query}':**")
st.write_stream(results)
else:
st.write("Please enter a search term.") |