|
from gradio_client import Client |
|
|
|
client = Client("https://ruslanmv-ai-medical-chatbot.hf.space/--replicas/93n5n/") |
|
result = client.predict( |
|
"Howdy!", |
|
fn_index=0 |
|
) |
|
print(result) |
|
|
|
|
|
|
|
|
|
|
|
import requests |
|
|
|
API_URL = "https://api-inference.huggingface.co/models/dmis-lab/biobert-base-cased-v1.1" |
|
headers = {"Authorization": "Bearer YOUR_HUGGING_FACE_API_KEY"} |
|
|
|
def query(payload): |
|
response = requests.post(API_URL, headers=headers, json=payload) |
|
return response.json() |
|
|
|
|
|
data = { |
|
"inputs": { |
|
"question": "What are the symptoms of COVID-19?", |
|
"context": "COVID-19 symptoms include fever, dry cough, and tiredness. Some patients may have aches and pains, nasal congestion, sore throat or diarrhea." |
|
} |
|
} |
|
|
|
result = query(data) |
|
print(result) |
|
|