nroggendorff commited on
Commit
5c3c196
·
verified ·
1 Parent(s): b7d4c4e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -1,9 +1,12 @@
1
  import gradio as gr
 
 
2
  from vllm import LLM, SamplingParams
3
 
4
  llm = LLM(model="meta-llama/Llama-2-7B-Chat-hf")
5
  sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
6
 
 
7
  def pipe(text: str):
8
  prompt = [text]
9
  tokens = llm.generate(prompt, sampling_params)
 
1
  import gradio as gr
2
+ import spaces
3
+
4
  from vllm import LLM, SamplingParams
5
 
6
  llm = LLM(model="meta-llama/Llama-2-7B-Chat-hf")
7
  sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
8
 
9
+ @spaces.GPU
10
  def pipe(text: str):
11
  prompt = [text]
12
  tokens = llm.generate(prompt, sampling_params)