madoss commited on
Commit
73129f8
1 Parent(s): cb97f50

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -39,17 +39,18 @@ def search(query, k):
39
  results.append(result)
40
 
41
  # Format results as a single string for single textbox output
42
- results_text = ("\n" + "*" * 15 + "\n").join([f'Title: {r["title"]}\nTranscript: {r["transcript"]}\nLink: {r["link"]}' for r in results])
 
43
 
44
  return {"Result": results_text}
45
 
46
  iface = gr.Interface(
47
  search,
48
  inputs=[
49
- gr.inputs.Textbox(label="Query", default="This is an example query"), # Adding a default example
50
  gr.inputs.Number(label="K", default=3),
51
  ],
52
- outputs=gr.outputs.Textbox(label="Result"), # Using single textbox for output
53
  title="Camembert and Faiss-powered Search Engine",
54
  description="Search through a dataset using Camembert and Faiss",
55
  theme="light",
 
39
  results.append(result)
40
 
41
  # Format results as a single string for single textbox output
42
+ results_text = ("<hr/>").join([f'Title: {r["title"]}<br/>Transcript: {r["transcript"]}<br/>Link: {r["link"]}' for r in results]
43
+ #results_text = ("\n" + "*" * 15 + "\n").join([f'Title: {r["title"]}\nTranscript: {r["transcript"]}\nLink: {r["link"]}' for r in results])
44
 
45
  return {"Result": results_text}
46
 
47
  iface = gr.Interface(
48
  search,
49
  inputs=[
50
+ gr.inputs.Textbox(label="Query", default="Qu'est-ce qui t'a le plus fait progresser ?"), # Adding a default example
51
  gr.inputs.Number(label="K", default=3),
52
  ],
53
+ outputs=gr.outputs.HTML(label="Result"), # Using single textbox for output
54
  title="Camembert and Faiss-powered Search Engine",
55
  description="Search through a dataset using Camembert and Faiss",
56
  theme="light",