Locutusque commited on
Commit
2d26215
1 Parent(s): 114115f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2,11 +2,11 @@ import gradio as gr
2
  from transformers import pipeline, AutoTokenizer
3
  import torch
4
  import spaces
5
- from huggingface_hub import secrets
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=secrets.get("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,