Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ API_TOKEN = os.environ.get("CLOUDFLARE_AUTH_TOKEN")
|
|
28 |
API_BASE_URL = "https://api.cloudflare.com/client/v4/accounts/a17f03e0f049ccae0c15cdcf3b9737ce/ai/run/"
|
29 |
|
30 |
print(f"ACCOUNT_ID: {ACCOUNT_ID}")
|
31 |
-
print(f"CLOUDFLARE_AUTH_TOKEN: {
|
32 |
|
33 |
MODELS = [
|
34 |
"mistralai/Mistral-7B-Instruct-v0.3",
|
@@ -104,7 +104,7 @@ def generate_chunked_response(prompt, model, max_tokens=1000, num_calls=3, tempe
|
|
104 |
try:
|
105 |
response = requests.post(
|
106 |
f"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/@cf/meta/llama-3.1-8b-instruct",
|
107 |
-
headers={"Authorization": f"Bearer {
|
108 |
json={
|
109 |
"stream": True,
|
110 |
"messages": [
|
|
|
28 |
API_BASE_URL = "https://api.cloudflare.com/client/v4/accounts/a17f03e0f049ccae0c15cdcf3b9737ce/ai/run/"
|
29 |
|
30 |
print(f"ACCOUNT_ID: {ACCOUNT_ID}")
|
31 |
+
print(f"CLOUDFLARE_AUTH_TOKEN: {API_TOKEN[:5]}..." if API_TOKEN else "Not set")
|
32 |
|
33 |
MODELS = [
|
34 |
"mistralai/Mistral-7B-Instruct-v0.3",
|
|
|
104 |
try:
|
105 |
response = requests.post(
|
106 |
f"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/@cf/meta/llama-3.1-8b-instruct",
|
107 |
+
headers={"Authorization": f"Bearer {API_TOKEN}"},
|
108 |
json={
|
109 |
"stream": True,
|
110 |
"messages": [
|