Akjava commited on
Commit
af67c6c
Β·
verified Β·
1 Parent(s): a53bf4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -8,6 +8,7 @@ import gradio as gr
8
  text_generator = None
9
  is_hugging_face = True
10
  model_id = "google/gemma-2-9b-it"
 
11
  huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
12
  device = "auto" # torch.device("cuda" if torch.cuda.is_available() else "cpu")
13
  device = "cuda"
@@ -52,7 +53,7 @@ if not is_hugging_face:
52
 
53
  print("initialized")
54
 
55
- @spaces.GPU(duration=10)
56
  def generate_text(messages):
57
  if is_hugging_face:#need everytime initialize for ZeroGPU
58
  model = AutoModelForCausalLM.from_pretrained(
 
8
  text_generator = None
9
  is_hugging_face = True
10
  model_id = "google/gemma-2-9b-it"
11
+ model_id = "google/gemma-2-2b-it"
12
  huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
13
  device = "auto" # torch.device("cuda" if torch.cuda.is_available() else "cpu")
14
  device = "cuda"
 
53
 
54
  print("initialized")
55
 
56
+ @spaces.GPU(duration=60)
57
  def generate_text(messages):
58
  if is_hugging_face:#need everytime initialize for ZeroGPU
59
  model = AutoModelForCausalLM.from_pretrained(