import gradio as gr from transformers import AutoTokenizer, AutoModelForCausalLM # Replace 'YOUR_ACCESS_TOKEN' with your actual Hugging Face access token model_name = "sambanovasystems/SambaNova-Qwen2.5-Coder-Artifacts" tokenizer = AutoTokenizer.from_pretrained(model_name, use_auth_token='YOUR_ACCESS_TOKEN') model = AutoModelForCausalLM.from_pretrained(model_name, use_auth_token='YOUR_ACCESS_TOKEN') def generate_text(prompt): # Generate text using the model inputs = tokenizer.encode(prompt, return_tensors="pt") outputs = model.generate(inputs, max_length=100, num_return_sequences=1) text = tokenizer.decode(outputs[0], skip_special_tokens=True) return text # Build the Gradio interface with gr.Blocks() as demo: gr.Markdown("