| import gradio as gr | |
| def greet(name): | |
| if not name: | |
| return "David." | |
| return f"Hello,David!" | |
| iface = gr.Interface( | |
| fn=chat_with_eduxgpt, | |
| inputs=gr.Textbox(Lines=1,placeholder="Ask Eduxgpt..."), | |
| outputs="text", | |
| title="Greeting App", | |
| description="Enter your name and receive a greeting!", | |
| live=True | |
| ) | |
| if __name__ == "__main__": | |
| try: | |
| iface.launch() | |
| except Exception as e: | |
| print(f"An error occurred: {e}") |