import gradio as gr from transformers import AutoModelForCausalLM, AutoTokenizer model_name = "groq/Llama-3-Groq-70B-Tool-Use" tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForCausalLM.from_pretrained(model_name) def generate_response(prompt): inputs = tokenizer(prompt, return_tensors="pt") outputs = model.generate(**inputs) response = tokenizer.decode(outputs[0], skip_special_tokens=True) return response iface = gr.Interface(fn=generate_response, inputs="text", outputs="text") iface.launch()