pagezyhf HF Staff commited on
Commit
ae1d265
·
1 Parent(s): f066ebc
Files changed (2) hide show
  1. app.py +9 -1
  2. requirements.txt +1 -2
app.py CHANGED
@@ -1,15 +1,23 @@
1
  import gradio as gr
2
  import requests
3
  import json
 
4
 
5
- def get_model_info(model_id):
 
 
 
6
  url = f"https://huggingface.co/api/integrations/aws/v1/lookup/{model_id}"
 
 
7
  response = requests.get(url)
8
 
9
  if response.status_code != 200:
 
10
  return f"Error: {response.status_code}\\nResponse: {response.text}"
11
 
12
  data = response.json()
 
13
  return json.dumps(data, indent=4)
14
 
15
  iface = gr.Interface(
 
1
  import gradio as gr
2
  import requests
3
  import json
4
+ import logging
5
 
6
+ # Set up logging
7
+ logging.basicConfig(level=logging.INFO)
8
+
9
+ def get_model_info(model_id="Qwen/Qwen2-7B-Instruct"):
10
  url = f"https://huggingface.co/api/integrations/aws/v1/lookup/{model_id}"
11
+ logging.info(f"Requesting model info for model ID: {model_id}")
12
+
13
  response = requests.get(url)
14
 
15
  if response.status_code != 200:
16
+ logging.error(f"Error: {response.status_code} - {response.text}")
17
  return f"Error: {response.status_code}\\nResponse: {response.text}"
18
 
19
  data = response.json()
20
+ logging.info("Successfully retrieved model info.")
21
  return json.dumps(data, indent=4)
22
 
23
  iface = gr.Interface(
requirements.txt CHANGED
@@ -1,2 +1 @@
1
- requests
2
- json
 
1
+ requests==2.32.3