Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,13 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
pipe = pipeline("text-generation", model="microsoft/DialoGPT-small")
|
| 5 |
|
|
@@ -18,8 +26,6 @@ def chat(message, history):
|
|
| 18 |
|
| 19 |
with gr.Blocks(title="AI Queen") as demo:
|
| 20 |
gr.Markdown("# AI Queen")
|
| 21 |
-
gr.Markdown("Your intelligent and majestic assistant")
|
| 22 |
gr.ChatInterface(fn=chat)
|
| 23 |
|
| 24 |
demo.launch()
|
| 25 |
-
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import subprocess
|
| 3 |
+
import sys
|
| 4 |
+
|
| 5 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "transformers", "torch", "--quiet"])
|
| 6 |
+
|
| 7 |
from transformers import pipeline
|
| 8 |
+
import time
|
| 9 |
+
|
| 10 |
+
time.sleep(10)
|
| 11 |
|
| 12 |
pipe = pipeline("text-generation", model="microsoft/DialoGPT-small")
|
| 13 |
|
|
|
|
| 26 |
|
| 27 |
with gr.Blocks(title="AI Queen") as demo:
|
| 28 |
gr.Markdown("# AI Queen")
|
|
|
|
| 29 |
gr.ChatInterface(fn=chat)
|
| 30 |
|
| 31 |
demo.launch()
|
|
|