Spaces:
Runtime error
Runtime error
Download app.py from ordify-roger/llava: direct link, hf CLI and curl.
- Browser
- Download file 819 Bytes
-
https://huggingface.co/spaces/ordify-roger/llava/resolve/main/app.py
- Command line
-
hf download hf://spaces/ordify-roger/llava/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ordify-roger/llava/resolve/main/app.py
819 Bytes
| import gradio as gr | |
| from transformers import AutoTokenizer, AutoModel | |
| # Load the tokenizer and model | |
| # Note: Replace 'your_model_name' with the actual model identifier | |
| tokenizer = AutoTokenizer.from_pretrained("liuhaotian/LLaVA-Lightning-7B-delta-v1.1") | |
| model = AutoModel.from_pretrained("liuhaotian/LLaVA-Lightning-7B-delta-v1.1") | |
| def generate_response(image, text_input): | |
| # Placeholder function; LLava requires GPU acceleration | |
| return "This is a placeholder response." | |
| iface = gr.Interface( | |
| fn=generate_response, | |
| inputs=[ | |
| gr.Image(type="pil", label="Input Image"), | |
| gr.Textbox(lines=2, placeholder="Enter your question here", label="Question") | |
| ], | |
| outputs="text", | |
| title="LLava Demo", | |
| description="An example of LLava running on Hugging Face Spaces." | |
| ) | |
| iface.launch() | |