Spaces:
Runtime error
Runtime error
init
Browse files- app.py +21 -0
- requirements.txt +1 -0
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import random
|
3 |
+
import time
|
4 |
+
|
5 |
+
model = gr.load("Tann-dev/sex-chat-dirty-girlfriend", src="models")
|
6 |
+
|
7 |
+
with gr.Blocks() as demo:
|
8 |
+
chatbot = gr.Chatbot()
|
9 |
+
msg = gr.Textbox()
|
10 |
+
clear = gr.ClearButton([msg, chatbot])
|
11 |
+
|
12 |
+
def respond(message, chat_history):
|
13 |
+
bot_message = model(message)
|
14 |
+
chat_history.append((message, bot_message))
|
15 |
+
time.sleep(2)
|
16 |
+
return "", chat_history
|
17 |
+
|
18 |
+
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
19 |
+
|
20 |
+
if __name__ == "__main__":
|
21 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
gradio
|