Spaces:
Runtime error
Runtime error
Download app.py from Ayush-Kumar2008/Study-Tools: direct link, hf CLI and curl.
- Browser
- Download file 1.46 kB
-
https://huggingface.co/spaces/Ayush-Kumar2008/Study-Tools/resolve/main/app.py
- Command line
-
hf download hf://spaces/Ayush-Kumar2008/Study-Tools/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Ayush-Kumar2008/Study-Tools/resolve/main/app.py
1.46 kB
| import gradio as gr | |
| # Define functions for each tab | |
| def generate_notes(subject): return f"Generated notes for {subject}..." | |
| def generate_quiz(subject): return f"Here is a quiz on {subject}..." | |
| def important_formulas(subject): return f"Important formulas for {subject}..." | |
| def career_suggestions(interest): return f"Career suggestions based on interest in {interest}..." | |
| # Tab 1: Notes Generator | |
| notes_interface = gr.Interface( fn=generate_notes, inputs=gr.Textbox(label="Enter Subject (e.g., Physics)"), outputs=gr.Textbox(label="Notes Output"), title="Notes Generator" ) | |
| # Tab 2: Quiz Generator | |
| quiz_interface = gr.Interface( fn=generate_quiz, inputs=gr.Textbox(label="Enter Subject (e.g., Chemistry)"), outputs=gr.Textbox(label="Quiz Output"), title="Quiz Generator" ) | |
| # Tab 3: Formula Helper | |
| formula_interface = gr.Interface( fn=important_formulas, inputs=gr.Textbox(label="Enter Subject (e.g., Maths)"), outputs=gr.Textbox(label="Formulas Output"), title="Formula Helper" ) | |
| # Tab 4: Career Suggestions | |
| career_interface = gr.Interface( fn=career_suggestions, inputs=gr.Textbox(label="Enter Your Interest (e.g., Biology)"), outputs=gr.Textbox(label="Suggested Careers"), title="Career Suggestions" ) | |
| # Combine all tabs into one app | |
| demo = gr.TabbedInterface( interface_list=[notes_interface, quiz_interface, formula_interface, career_interface], tab_names=["Notes", "Quiz", "Formulas", "Careers"] ) | |
| if __name__ == "__main__": | |
| demo.launch() |