xsa-dev's picture
add first application file
637df7e
raw
history blame
492 Bytes
import gradio as gr
from transformers import AutoModel, pipeline
from transformers import AutoTokenizer, AutoModelForCausalLM
pipe = pipeline("text-generation", model="meta-llama/Llama-2-7b-chat-hf")
# tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-chat-hf")
# model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-chat-hf")
def greet(name):
return "Hello " + name + "!!"
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()