Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -78,7 +78,7 @@ index.add(text_embeddings)
|
|
78 |
|
79 |
print("Finish the model init process")
|
80 |
|
81 |
-
def qa(question: str
|
82 |
|
83 |
|
84 |
|
@@ -97,13 +97,14 @@ def qa(question: str, doc: str) -> str:
|
|
97 |
[INST] Requête: {question} [/INST]
|
98 |
Réponse:
|
99 |
"""
|
100 |
-
|
101 |
-
return prompt
|
102 |
|
103 |
|
104 |
demo = gr.Interface(
|
105 |
qa,
|
106 |
-
[gr.Textbox(label="Question")
|
|
|
107 |
gr.Textbox()
|
108 |
)
|
109 |
if __name__ == "__main__":
|
|
|
78 |
|
79 |
print("Finish the model init process")
|
80 |
|
81 |
+
def qa(question: str) -> str:
|
82 |
|
83 |
|
84 |
|
|
|
97 |
[INST] Requête: {question} [/INST]
|
98 |
Réponse:
|
99 |
"""
|
100 |
+
outputs = model.generate(prompt=prompt, temp=0.5, top_k = 40, top_p = 1, max_tokens = max_new_tokens)
|
101 |
+
return prompt "".join(outputs)
|
102 |
|
103 |
|
104 |
demo = gr.Interface(
|
105 |
qa,
|
106 |
+
[gr.Textbox(label="Question")#, PDF(label="Document")
|
107 |
+
],
|
108 |
gr.Textbox()
|
109 |
)
|
110 |
if __name__ == "__main__":
|