Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -225,10 +225,10 @@ def get_llama_response(message):
|
|
225 |
AI:""".strip()
|
226 |
|
227 |
|
228 |
-
|
229 |
|
230 |
-
|
231 |
-
inputs = tokenizer(
|
232 |
|
233 |
# Generate text
|
234 |
with torch.no_grad():
|
@@ -236,9 +236,6 @@ def get_llama_response(message):
|
|
236 |
|
237 |
# Decode the generated text
|
238 |
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
239 |
-
|
240 |
-
#chain.prompt=prompt
|
241 |
-
#res = chain(query_text)
|
242 |
return(generated_text)
|
243 |
|
244 |
import gradio as gr
|
|
|
225 |
AI:""".strip()
|
226 |
|
227 |
|
228 |
+
input_text = query_text
|
229 |
|
230 |
+
# Tokenize the input text
|
231 |
+
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
|
232 |
|
233 |
# Generate text
|
234 |
with torch.no_grad():
|
|
|
236 |
|
237 |
# Decode the generated text
|
238 |
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
|
|
|
|
|
|
239 |
return(generated_text)
|
240 |
|
241 |
import gradio as gr
|