Spaces:
Sleeping
Sleeping
DJONG-WANG
commited on
Commit
•
f2c670c
1
Parent(s):
18d65eb
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
-
import random
|
4 |
import time
|
|
|
|
|
|
|
|
|
5 |
|
6 |
# Création du pipeline pour le modèle de Hugging Face
|
7 |
-
pipe = pipeline(task='text-generation', model='
|
8 |
|
9 |
# Création de l'interface Gradio
|
10 |
with gr.Blocks() as demo:
|
@@ -22,4 +25,4 @@ with gr.Blocks() as demo:
|
|
22 |
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
23 |
|
24 |
if __name__ == "__main__":
|
25 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
|
|
3 |
import time
|
4 |
+
!pip install sentencepiece
|
5 |
+
import sentencepiece
|
6 |
+
from transformers import pipeline
|
7 |
+
|
8 |
|
9 |
# Création du pipeline pour le modèle de Hugging Face
|
10 |
+
pipe = pipeline(task='text-generation', model='Mohammed-Altaf/Medical-ChatBot')
|
11 |
|
12 |
# Création de l'interface Gradio
|
13 |
with gr.Blocks() as demo:
|
|
|
25 |
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
26 |
|
27 |
if __name__ == "__main__":
|
28 |
+
demo.launch()
|