pagezyhf's picture
pagezyhf HF Staff
Update app.py
35429d6 verified
raw
history blame
790 Bytes
import gradio as gr
import requests
import json
def get_model_info(model_id):
url = f"https://huggingface.co/api/integrations/aws/v1/lookup/{model_id}"
response = requests.get(url)
if response.status_code != 200:
return f"Error: Unable to fetch data for {model_id}. Status code: {response.status_code}"
data = response.json()
return json.dumps(data, indent=4)
iface = gr.Interface(
fn=get_model_info,
inputs=gr.Textbox(label="Model ID", placeholder="Enter model ID, e.g., HuggingFaceH4/zephyr-7b-beta"),
outputs=gr.Textbox(label="API Response", lines=20),
title="Hugging Face Model Lookup",
description="Enter a model ID to retrieve its AWS integration details from Hugging Face."
)
if __name__ == "__main__":
iface.launch()