abdullahalioo commited on
Commit
d554386
·
verified ·
1 Parent(s): 79018fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
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
+