Nekochu commited on
Commit
53d1a2e
1 Parent(s): 975a4dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,9 +1,10 @@
 
1
  from threading import Thread
2
  from typing import Iterator
 
3
  import gradio as gr
4
  import spaces
5
  import torch
6
- import os
7
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
8
 
9
  MAX_MAX_NEW_TOKENS = 2048
@@ -26,6 +27,7 @@ LICENSE = """<p/> ---."""
26
  if not torch.cuda.is_available():
27
  DESCRIPTION += "\n<p>Running on CPU This demo does not work on CPU.</p>"
28
 
 
29
  def generate(
30
  message: str,
31
  chat_history: list[tuple[str, str]],
 
1
+ import os
2
  from threading import Thread
3
  from typing import Iterator
4
+
5
  import gradio as gr
6
  import spaces
7
  import torch
 
8
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
9
 
10
  MAX_MAX_NEW_TOKENS = 2048
 
27
  if not torch.cuda.is_available():
28
  DESCRIPTION += "\n<p>Running on CPU This demo does not work on CPU.</p>"
29
 
30
+ @spaces.GPU(duration=120)
31
  def generate(
32
  message: str,
33
  chat_history: list[tuple[str, str]],