Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ embeddings = HuggingFaceEmbeddings(
|
|
42 |
encode_kwargs=encode_kwargs
|
43 |
)
|
44 |
|
45 |
-
index = faiss.load_local("resourse/embeddings_ngap.faiss")
|
46 |
|
47 |
def get_text_embedding(text):
|
48 |
|
@@ -78,7 +78,7 @@ def vote(data: gr.LikeData):
|
|
78 |
return
|
79 |
|
80 |
chatbot = gr.Chatbot(avatar_images=('resourse/user-icon.png', 'resourse/chatbot-icon.png'),bubble_full_width = False)
|
81 |
-
|
82 |
additional_inputs=[
|
83 |
gr.Slider(
|
84 |
label="temperature",
|
@@ -108,23 +108,17 @@ additional_inputs=[
|
|
108 |
info="limits candidate tokens to a fixed number after sorting by probability. Setting it higher than the vocabulary size deactivates this limit.",
|
109 |
)
|
110 |
]
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
iface = gr.ChatInterface(
|
116 |
fn = generater,
|
117 |
title=title,
|
118 |
description = description,
|
119 |
chatbot=chatbot,
|
120 |
additional_inputs=additional_inputs,
|
121 |
-
|
122 |
-
# ["Hello there! How are you doing?"],
|
123 |
-
# ["How many hours does it take a man to eat a Helicopter?"],
|
124 |
-
# ["You are a helpful and honest assistant. Always answer as helpfully as possible. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information."],
|
125 |
-
#["I want you to act as a spoken English teacher and improver. I will speak to you in English and you will reply to me in English to practice my spoken English. I want you to strictly correct my grammar mistakes, typos, and factual errors. I want you to ask me a question in your reply. Now let's start practicing, you could ask me a question first. Remember, I want you to strictly correct my grammar mistakes, typos, and factual errors."],
|
126 |
-
#[f"I want you to act like {character} from {series}. I want you to respond and answer like {character} using the tone, manner and vocabulary {character} would use. Do not write any explanations. Only answer like {character}. You must know all of the knowledge of {character}."]
|
127 |
-
#]
|
128 |
)
|
129 |
|
130 |
with gr.Blocks(css="resourse/style/custom.css") as demo:
|
|
|
42 |
encode_kwargs=encode_kwargs
|
43 |
)
|
44 |
|
45 |
+
#index = faiss.load_local("resourse/embeddings_ngap.faiss")
|
46 |
|
47 |
def get_text_embedding(text):
|
48 |
|
|
|
78 |
return
|
79 |
|
80 |
chatbot = gr.Chatbot(avatar_images=('resourse/user-icon.png', 'resourse/chatbot-icon.png'),bubble_full_width = False)
|
81 |
+
"""
|
82 |
additional_inputs=[
|
83 |
gr.Slider(
|
84 |
label="temperature",
|
|
|
108 |
info="limits candidate tokens to a fixed number after sorting by probability. Setting it higher than the vocabulary size deactivates this limit.",
|
109 |
)
|
110 |
]
|
111 |
+
"""
|
112 |
+
additional_inputs=[
|
113 |
+
gr.UploadButton(file_types=[".pdf",".csv",".doc"])
|
114 |
+
]
|
115 |
iface = gr.ChatInterface(
|
116 |
fn = generater,
|
117 |
title=title,
|
118 |
description = description,
|
119 |
chatbot=chatbot,
|
120 |
additional_inputs=additional_inputs,
|
121 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
)
|
123 |
|
124 |
with gr.Blocks(css="resourse/style/custom.css") as demo:
|