Spaces:
Runtime error
Runtime error
Create app.py
Browse files1234567891011121314151617181920212223242526272829303132import gradio as gr
# Function to collect the datadef collect_course_allocation(faculty_name, faculty_photo, subject_name, course_type, credit_hours, department_name): # Store or process the data result = f"Department: {department_name}\nFaculty Name: {faculty_name}\nSubject: {subject_name}\n" result += f"Course Type: {course_type}\nCredit Hours: {credit_hours}\n" # Save or process the faculty photo (you can store it in a folder or a database) # Here, we just display the photo photo_message = f"Faculty Photo: {faculty_photo.name}" return result, photo_message
# Create the form inputsdepartment_name = gr.Textbox(label="Department Name")faculty_name = gr.Textbox(label="Faculty Name")faculty_photo = gr.Image(label="Upload Faculty Photo")subject_name = gr.Textbox(label="Subject Name")course_type = gr.Radio(choices=["Theory", "Lab"], label="Course Type")credit_hours = gr.Number(label="Credit Hours", min_value=1, max_value=5, value=3)submit_button = gr.Button("Submit")
# Set up Gradio interfaceiface = gr.Interface( fn=collect_course_allocation, inputs=[department_name, faculty_name, faculty_photo, subject_name, course_type, credit_hours], outputs=["text", "text"], live=True)
iface.launch()app.pyAdded+32