Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -50,6 +50,7 @@ def init():
|
|
50 |
|
51 |
@spaces.GPU(duration=120)
|
52 |
def generate_text(messages):
|
|
|
53 |
if is_hugging_face:#need everytime initialize for ZeroGPU
|
54 |
model = AutoModelForCausalLM.from_pretrained(
|
55 |
model_id, token=huggingface_token ,torch_dtype=dtype,device_map=device
|
|
|
50 |
|
51 |
@spaces.GPU(duration=120)
|
52 |
def generate_text(messages):
|
53 |
+
global text_generator
|
54 |
if is_hugging_face:#need everytime initialize for ZeroGPU
|
55 |
model = AutoModelForCausalLM.from_pretrained(
|
56 |
model_id, token=huggingface_token ,torch_dtype=dtype,device_map=device
|