Spaces:
Runtime error
Runtime error
Download app.py from varox34/Llama-3-Mistral-v0.2-Instruct-slerp: direct link, hf CLI and curl.
- Browser
- Download file 788 Bytes
-
https://huggingface.co/spaces/varox34/Llama-3-Mistral-v0.2-Instruct-slerp/resolve/main/app.py
- Command line
-
hf download hf://spaces/varox34/Llama-3-Mistral-v0.2-Instruct-slerp/app.py
-
curl -L -o app.py https://huggingface.co/spaces/varox34/Llama-3-Mistral-v0.2-Instruct-slerp/resolve/main/app.py
788 Bytes
| import gradio as gr | |
| # Replace with the actual LLaMa3 model ID from Hugging Face Hub when available | |
| model_id = "varox34/Llama-3-Mistral-v0.2-Instruct-slerp" | |
| def inference(prompt): | |
| # Import necessary libraries (replace with LLaMa3-specific ones) | |
| from transformers import pipeline | |
| # Create a pipeline using the LLaMa3 model ID (assuming compatibility) | |
| pipe = pipeline("text-generation", model=model_id) | |
| # Generate text based on the prompt | |
| response = pipe(prompt, max_length=250, num_return_sequences=1)[0]["generated_text"] | |
| return response | |
| interface = gr.Interface( | |
| fn=inference, | |
| inputs="text", | |
| outputs="text", | |
| title="LLama3 Inference", | |
| description="Enter a prompt and get text generated by LLaMa3 (if available).", | |
| ) | |
| interface.launch() | |