Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,10 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
|
|
|
|
|
|
4 |
# Initialize the Qwen model pipeline
|
5 |
pipe = pipeline("text-generation", model="Qwen/Qwen1.5-0.5B")
|
6 |
|
@@ -37,3 +41,4 @@ with gr.Blocks() as demo:
|
|
37 |
inputs=[user_input, state],
|
38 |
outputs=[chatbot_output, state]
|
39 |
)
|
|
|
|
1 |
+
import os
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
5 |
+
# Set the cache directory to a writable location
|
6 |
+
os.environ["TRANSFORMERS_CACHE"] = "/app/cache"
|
7 |
+
|
8 |
# Initialize the Qwen model pipeline
|
9 |
pipe = pipeline("text-generation", model="Qwen/Qwen1.5-0.5B")
|
10 |
|
|
|
41 |
inputs=[user_input, state],
|
42 |
outputs=[chatbot_output, state]
|
43 |
)
|
44 |
+
|