| | import gradio as gr |
| | import requests |
| |
|
| | |
| | api_url_1 = "https://huggingface.co/spaces/Nurisslam/Lung_Disease_Classification/run/predict" |
| | api_url_2 = "https://nurisslam-ai-dem.hf.space/run/predict" |
| |
|
| | |
| | def call_api_1(input_data): |
| | response = requests.post(api_url_1, json={"data": input_data}) |
| | return response.json() |
| |
|
| | def call_api_2(input_data): |
| | response = requests.post(api_url_2, json={"data": input_data}) |
| | return response.json() |
| |
|
| | |
| | interface_1 = gr.Interface( |
| | fn=call_api_1, |
| | inputs="text", |
| | outputs="json", |
| | title="API 1", |
| | description="Бұл бірінші API-ға сұрау жіберу" |
| | ) |
| |
|
| | |
| | interface_2 = gr.Interface( |
| | fn=call_api_2, |
| | inputs="text", |
| | outputs="json", |
| | title="API 2", |
| | description="Бұл екінші API-ға сұрау жіберу" |
| | ) |
| |
|
| | |
| | interface_1.launch(share=True) |
| | interface_2.launch(share=True) |
| |
|