Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| def generate_telugu(prompt, content_type): | |
| return f"Coming soon! నాదిని is being set up...\n\nYour prompt: {prompt}\nType: {content_type}\n\nPlease visit: https://huggingface.co/mohantvj/naadini-telugu for usage instructions." | |
| with gr.Blocks(title="నాదిని - Telugu Creative AI") as demo: | |
| gr.Markdown(""" | |
| # 🎵 నాదిని (Naadini) - Telugu Creative AI | |
| **నాదిని** means *"She who is the source of divine sound, poetry and wisdom"* | |
| ⚠️ Full model requires Apple Silicon Mac. | |
| See [model page](https://huggingface.co/mohantvj/naadini-telugu) for installation. | |
| తెలుగులో కవితలు, పాటలు, కథలు రాయండి! | |
| """) | |
| with gr.Row(): | |
| with gr.Column(): | |
| content_type = gr.Dropdown( | |
| choices=[ | |
| "కవిత (Poem)", | |
| "పాట (Song)", | |
| "కథ (Story)", | |
| "పద్యం (Classical)", | |
| "సంభాషణ (Conversation)" | |
| ], | |
| value="కవిత (Poem)", | |
| label="What to Write" | |
| ) | |
| prompt = gr.Textbox( | |
| placeholder="వర్షం గురించి ఒక కవిత రాయండి...", | |
| label="Your Prompt", | |
| lines=3 | |
| ) | |
| generate_btn = gr.Button("✨ Generate", variant="primary") | |
| with gr.Column(): | |
| output = gr.Textbox( | |
| label="నాదిని's Response", | |
| lines=15 | |
| ) | |
| gr.Examples( | |
| examples=[ | |
| ["వర్షం గురించి ఒక అందమైన కవిత రాయండి", "కవిత (Poem)"], | |
| ["అమ్మ గురించి ఒక పాట రాయండి", "పాట (Song)"], | |
| ["పిల్లల కోసం ఒక చిన్న కథ రాయండి", "కథ (Story)"], | |
| ], | |
| inputs=[prompt, content_type] | |
| ) | |
| generate_btn.click( | |
| fn=generate_telugu, | |
| inputs=[prompt, content_type], | |
| outputs=output | |
| ) | |
| gr.Markdown(""" | |
| --- | |
| Built with ❤️ by **Thonangi Venkata Jagan Mohan** | |
| ## How to Use Locally | |
| ```bash | |
| pip install mlx-lm | |
| ``` | |
| ```python | |
| from mlx_lm import load, generate | |
| from mlx_lm.sample_utils import make_sampler | |
| model, tokenizer = load( | |
| "mlx-community/Qwen3-14B-4bit", | |
| adapter_path="mohantvj/naadini-telugu" | |
| ) | |
| ``` | |
| """) | |
| demo.launch() |