You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

YAML transformers

import os import gradio as gr from huggingface_hub import InferenceClient

1. Initialize the Inference Client

Replace 'your_hf_token_here' with the token copied from Step 1

HF_TOKEN = "your_hf_token_here" client = InferenceClient(model="meta-llama/Llama-3-8B-Instruct", token=HF_TOKEN)

2. Define the core prediction logic

def generate_response(prompt): try: # Call the Inference API response = client.text_generation(prompt, max_new_tokens=150) return response except Exception as e: return f"Error connecting to Hugging Face API: {str(e)}"

3. Create the Web Interface (Gradio)

demo = gr.Interface( fn=generate_response, inputs=gr.Textbox(lines=2, placeholder="Ask the model anything..."), outputs="text", title="Hugging Face Model Interface", description="Ask questions via the Hugging Face serverless Inference API." )

4. Launch the application

if name == "main": demo.launch(share=True)

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support