Spaces:
Sleeping
Sleeping
app.py
CHANGED
@@ -8,20 +8,13 @@ import os
|
|
8 |
logging.basicConfig(level=logging.INFO)
|
9 |
|
10 |
def get_model_info(model_id="Qwen/Qwen2-7B-Instruct", hf_token=os.getenv('HF_TOKEN')):
|
11 |
-
url = f"https://huggingface.co/api/
|
12 |
-
params = {
|
13 |
-
"limit": 5,
|
14 |
-
"pipeline_tag": "text-generation",
|
15 |
-
"sort": "likes30d",
|
16 |
-
"full": "True",
|
17 |
-
"config": "True"
|
18 |
-
}
|
19 |
|
20 |
headers = {}
|
21 |
if hf_token:
|
22 |
headers["Authorization"] = f"Bearer {hf_token}"
|
23 |
try:
|
24 |
-
response = requests.get(url,
|
25 |
except requests.exceptions.RequestException as e:
|
26 |
print(f"Error fetching data for task text-generation: {e}")
|
27 |
return None
|
|
|
8 |
logging.basicConfig(level=logging.INFO)
|
9 |
|
10 |
def get_model_info(model_id="Qwen/Qwen2-7B-Instruct", hf_token=os.getenv('HF_TOKEN')):
|
11 |
+
url = f"https://huggingface.co/api/integrations/aws/v1/lookup/{model_id}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
headers = {}
|
14 |
if hf_token:
|
15 |
headers["Authorization"] = f"Bearer {hf_token}"
|
16 |
try:
|
17 |
+
response = requests.get(url, headers=headers)
|
18 |
except requests.exceptions.RequestException as e:
|
19 |
print(f"Error fetching data for task text-generation: {e}")
|
20 |
return None
|