Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import os
|
| 2 |
from huggingface_hub import login
|
| 3 |
-
from smolagents import InferenceClientModel
|
| 4 |
|
| 5 |
# Load the API key
|
| 6 |
api_key = os.getenv('WingTokenAll')
|
|
@@ -8,16 +7,4 @@ api_key = os.getenv('WingTokenAll')
|
|
| 8 |
# Log in using the API key
|
| 9 |
login(api_key)
|
| 10 |
|
| 11 |
-
|
| 12 |
-
model = InferenceClientModel(
|
| 13 |
-
model='Qwen/Qwen2.5-Coder-32B-Instruct',
|
| 14 |
-
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
|
| 15 |
-
provider='auto' # Use 'auto' or a valid provider
|
| 16 |
-
)
|
| 17 |
-
|
| 18 |
-
# Attempt to generate a response (adjust parameters as needed)
|
| 19 |
-
try:
|
| 20 |
-
response = model.chat_completion(inputs="Hello, how can I help you?")
|
| 21 |
-
print(response)
|
| 22 |
-
except Exception as e:
|
| 23 |
-
print(f"Error: {e}")
|
|
|
|
| 1 |
import os
|
| 2 |
from huggingface_hub import login
|
|
|
|
| 3 |
|
| 4 |
# Load the API key
|
| 5 |
api_key = os.getenv('WingTokenAll')
|
|
|
|
| 7 |
# Log in using the API key
|
| 8 |
login(api_key)
|
| 9 |
|
| 10 |
+
print("Logged in successfully!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|