Spaces:
Runtime error
Runtime error
Retrieving HF_TOKEN via os
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import json
|
| 2 |
from typing import List, Any, Dict, Tuple, Union
|
| 3 |
import gradio as gr
|
|
@@ -40,7 +41,7 @@ def generate_quiz(
|
|
| 40 |
if q_type == "Multiple Choice":
|
| 41 |
user_msg += "Each question should have 4 answer choices, unlabeled, and one correct answer."
|
| 42 |
|
| 43 |
-
client = InferenceClient(provider="together")
|
| 44 |
response = client.chat.completions.create(
|
| 45 |
model="openai/gpt-oss-120b",
|
| 46 |
messages=[
|
|
|
|
| 1 |
+
import os
|
| 2 |
import json
|
| 3 |
from typing import List, Any, Dict, Tuple, Union
|
| 4 |
import gradio as gr
|
|
|
|
| 41 |
if q_type == "Multiple Choice":
|
| 42 |
user_msg += "Each question should have 4 answer choices, unlabeled, and one correct answer."
|
| 43 |
|
| 44 |
+
client = InferenceClient(provider="together", api_key=os.getenv("HF_TOKEN"))
|
| 45 |
response = client.chat.completions.create(
|
| 46 |
model="openai/gpt-oss-120b",
|
| 47 |
messages=[
|