Spaces:
Running
on
Zero
Running
on
Zero
Locutusque
commited on
Commit
•
2d26215
1
Parent(s):
114115f
Update app.py
Browse files
app.py
CHANGED
@@ -2,11 +2,11 @@ import gradio as gr
|
|
2 |
from transformers import pipeline, AutoTokenizer
|
3 |
import torch
|
4 |
import spaces
|
5 |
-
|
6 |
|
7 |
@spaces.GPU
|
8 |
def load_model(model_name):
|
9 |
-
return pipeline("text-generation", model=model_name, device="cuda", torch_dtype=torch.float16, trust_remote_code=True, token=
|
10 |
@spaces.GPU
|
11 |
def generate(
|
12 |
model_name,
|
|
|
2 |
from transformers import pipeline, AutoTokenizer
|
3 |
import torch
|
4 |
import spaces
|
5 |
+
import os
|
6 |
|
7 |
@spaces.GPU
|
8 |
def load_model(model_name):
|
9 |
+
return pipeline("text-generation", model=model_name, device="cuda", torch_dtype=torch.float16, trust_remote_code=True, token=os.environ["token"])
|
10 |
@spaces.GPU
|
11 |
def generate(
|
12 |
model_name,
|