Spaces:
Sleeping
Sleeping
fix parameters
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ def add_text(history, text):
|
|
35 |
return history, gr.Textbox(value="", interactive=False)
|
36 |
|
37 |
|
38 |
-
def bot(history, api_kind, chunk_table, embedding_model, llm_model, cross_encoder, rerank_topk ):
|
39 |
top_k_param = int(top_k_param)
|
40 |
query = history[-1][0]
|
41 |
|
@@ -62,12 +62,23 @@ def bot(history, api_kind, chunk_table, embedding_model, llm_model, cross_encode
|
|
62 |
prompt = template.render(documents=documents, query=query)
|
63 |
prompt_html = template_html.render(documents=documents, query=query)
|
64 |
|
65 |
-
if
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
history[-1][1] = ""
|
73 |
for character in generate_fn(prompt, history[:-1]):
|
@@ -117,6 +128,7 @@ with gr.Blocks() as demo:
|
|
117 |
)
|
118 |
llm_model = gr.Radio(
|
119 |
choices=[
|
|
|
120 |
"gpt-3.5-turbo",
|
121 |
"gpt-4-turbo-preview",
|
122 |
"mistralai/Mistral-7B-v0.1",
|
|
|
35 |
return history, gr.Textbox(value="", interactive=False)
|
36 |
|
37 |
|
38 |
+
def bot(history, api_kind, chunk_table, embedding_model, llm_model, cross_encoder, top_k_param, rerank_topk ):
|
39 |
top_k_param = int(top_k_param)
|
40 |
query = history[-1][0]
|
41 |
|
|
|
62 |
prompt = template.render(documents=documents, query=query)
|
63 |
prompt_html = template_html.render(documents=documents, query=query)
|
64 |
|
65 |
+
if llm_model == "mistralai/Mistral-7B-Instruct-v0.2":
|
66 |
+
pass
|
67 |
+
if llm_model == "mistralai/Mistral-7B-v0.1":
|
68 |
+
pass
|
69 |
+
if llm_model == "mistralai/Mixtral-8x7B-Instruct-v0.1":
|
70 |
+
pass
|
71 |
+
if llm_model == "gpt-3.5-turbo":
|
72 |
+
pass
|
73 |
+
if llm_model == "gpt-4-turbo-preview":
|
74 |
+
pass
|
75 |
+
|
76 |
+
#if api_kind == "HuggingFace":
|
77 |
+
# generate_fn = generate_hf
|
78 |
+
#elif api_kind == "OpenAI":
|
79 |
+
# generate_fn = generate_openai
|
80 |
+
#else:
|
81 |
+
# raise gr.Error(f"API {api_kind} is not supported")
|
82 |
|
83 |
history[-1][1] = ""
|
84 |
for character in generate_fn(prompt, history[:-1]):
|
|
|
128 |
)
|
129 |
llm_model = gr.Radio(
|
130 |
choices=[
|
131 |
+
"mistralai/Mistral-7B-Instruct-v0.2",
|
132 |
"gpt-3.5-turbo",
|
133 |
"gpt-4-turbo-preview",
|
134 |
"mistralai/Mistral-7B-v0.1",
|