NCTCMumbai
commited on
Commit
•
8a239f7
1
Parent(s):
b55d206
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ from jinja2 import Environment, FileSystemLoader
|
|
16 |
import numpy as np
|
17 |
from sentence_transformers import CrossEncoder
|
18 |
|
19 |
-
from backend.query_llm import generate_hf, generate_openai
|
20 |
from backend.semantic_search import table, retriever
|
21 |
|
22 |
VECTOR_COLUMN_NAME = "vector"
|
@@ -93,8 +93,8 @@ def bot(history, api_kind):
|
|
93 |
|
94 |
if api_kind == "HuggingFace":
|
95 |
generate_fn = generate_hf
|
96 |
-
elif api_kind == "
|
97 |
-
generate_fn =
|
98 |
elif api_kind is None:
|
99 |
gr.Warning("API name was not provided")
|
100 |
raise ValueError("API name was not provided")
|
@@ -143,7 +143,7 @@ with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
|
|
143 |
)
|
144 |
txt_btn = gr.Button(value="Submit text", scale=1)
|
145 |
|
146 |
-
api_kind = gr.Radio(choices=["HuggingFace"], value="HuggingFace")
|
147 |
|
148 |
prompt_html = gr.HTML()
|
149 |
try:
|
|
|
16 |
import numpy as np
|
17 |
from sentence_transformers import CrossEncoder
|
18 |
|
19 |
+
from backend.query_llm import generate_hf, generate_openai,generate_gemini
|
20 |
from backend.semantic_search import table, retriever
|
21 |
|
22 |
VECTOR_COLUMN_NAME = "vector"
|
|
|
93 |
|
94 |
if api_kind == "HuggingFace":
|
95 |
generate_fn = generate_hf
|
96 |
+
elif api_kind == "Gemini":
|
97 |
+
generate_fn = generate_gemini
|
98 |
elif api_kind is None:
|
99 |
gr.Warning("API name was not provided")
|
100 |
raise ValueError("API name was not provided")
|
|
|
143 |
)
|
144 |
txt_btn = gr.Button(value="Submit text", scale=1)
|
145 |
|
146 |
+
api_kind = gr.Radio(choices=["HuggingFace","Gemini"], value="HuggingFace")
|
147 |
|
148 |
prompt_html = gr.HTML()
|
149 |
try:
|