Spaces:
Runtime error
Runtime error
Fixing model choice
Browse files
app.py
CHANGED
@@ -71,7 +71,7 @@ def set_model(history):
|
|
71 |
|
72 |
def ingest(url, canvas_api_key, history):
|
73 |
global grader, llm, embeddings
|
74 |
-
text = f"
|
75 |
ingest_canvas_discussions(url, canvas_api_key)
|
76 |
grader = Grader(grading_model)
|
77 |
response = "Ingested canvas data successfully"
|
@@ -84,6 +84,8 @@ def start_grading(url, canvas_api_key, history):
|
|
84 |
if not url or not canvas_api_key:
|
85 |
response = "Please enter all the fields to initiate grading"
|
86 |
elif grader:
|
|
|
|
|
87 |
# Create a new event loop
|
88 |
loop = asyncio.new_event_loop()
|
89 |
asyncio.set_event_loop(loop)
|
@@ -161,6 +163,7 @@ def enable_fields(url_status, canvas_api_key_status, submit_status, grade_status
|
|
161 |
if not canvas_api_key_status:
|
162 |
canvas_api_key.placeholder = "Data already ingested"
|
163 |
|
|
|
164 |
def bot(history):
|
165 |
return history
|
166 |
|
|
|
71 |
|
72 |
def ingest(url, canvas_api_key, history):
|
73 |
global grader, llm, embeddings
|
74 |
+
text = f"Downloaded discussion data from {url} to start grading"
|
75 |
ingest_canvas_discussions(url, canvas_api_key)
|
76 |
grader = Grader(grading_model)
|
77 |
response = "Ingested canvas data successfully"
|
|
|
84 |
if not url or not canvas_api_key:
|
85 |
response = "Please enter all the fields to initiate grading"
|
86 |
elif grader:
|
87 |
+
if grader.llm.model_name != grading_model:
|
88 |
+
grader = Grader(grading_model)
|
89 |
# Create a new event loop
|
90 |
loop = asyncio.new_event_loop()
|
91 |
asyncio.set_event_loop(loop)
|
|
|
163 |
if not canvas_api_key_status:
|
164 |
canvas_api_key.placeholder = "Data already ingested"
|
165 |
|
166 |
+
|
167 |
def bot(history):
|
168 |
return history
|
169 |
|