Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
import torch
|
3 |
from transformers import pipeline
|
4 |
|
5 |
-
pipe = pipeline("text-generation", model="
|
6 |
|
7 |
def model_generate(text):
|
8 |
# We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
|
@@ -18,6 +18,4 @@ def model_generate(text):
|
|
18 |
return outputs[0]["generated_text"]
|
19 |
|
20 |
iface = gr.Interface(fn=model_generate, inputs=["text"], outputs="text")
|
21 |
-
iface.launch()
|
22 |
-
|
23 |
-
gr.load("models/TinyLlama/TinyLlama-1.1B-Chat-v1.0").launch()
|
|
|
2 |
import torch
|
3 |
from transformers import pipeline
|
4 |
|
5 |
+
pipe = pipeline("text-generation", model="meta-llama/Llama-2-70b-chat-hf", torch_dtype=torch.bfloat16, device_map="auto")
|
6 |
|
7 |
def model_generate(text):
|
8 |
# We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
|
|
|
18 |
return outputs[0]["generated_text"]
|
19 |
|
20 |
iface = gr.Interface(fn=model_generate, inputs=["text"], outputs="text")
|
21 |
+
iface.launch()
|
|
|
|