mini / app.py
Obotu's picture
Rename main.py to app.py
0a83183 verified
raw
history blame
824 Bytes
from gradio_client import Client
client = Client("https://ruslanmv-ai-medical-chatbot.hf.space/--replicas/93n5n/")
result = client.predict(
"Howdy!", # str in 'Input Prompt' Textbox component
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()
# Example query
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)