Spaces:
Sleeping
Sleeping
Commit
•
33f7aea
1
Parent(s):
a55df40
Update app.py
Browse files
app.py
CHANGED
@@ -5,23 +5,9 @@ import sentencepiece
|
|
5 |
from transformers import pipeline
|
6 |
|
7 |
|
8 |
-
|
9 |
-
pipe = pipeline(task='text-generation', model='Mohammed-Altaf/Medical-ChatBot')
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
chatbot = gr.Chatbot()
|
14 |
-
msg = gr.Textbox()
|
15 |
-
clear = gr.ClearButton([msg, chatbot])
|
16 |
|
17 |
-
|
18 |
-
# Utilisation du modèle de Hugging Face pour générer une réponse
|
19 |
-
bot_message = pipe(message, max_length=50)[0]['generated_text']
|
20 |
-
chat_history.append((message, bot_message))
|
21 |
-
time.sleep(2)
|
22 |
-
return "", chat_history
|
23 |
-
|
24 |
-
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
25 |
-
|
26 |
-
if __name__ == "__main__":
|
27 |
-
demo.launch()
|
|
|
5 |
from transformers import pipeline
|
6 |
|
7 |
|
8 |
+
pipe = pipeline(task='question-answering', model='CATIE-AQ/QAmembert-large')
|
|
|
9 |
|
10 |
+
title = "Chatbot pour la recherche de réponses"
|
11 |
+
description = "Un chatbot intelligent qui prend un contexte et une question en entrée, et essaie de trouver la réponse dans le contexte."
|
|
|
|
|
|
|
12 |
|
13 |
+
gr.Interface.from_pipeline(pipe, title=title, description=description).launch(inbrowser=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|