Spaces:
Runtime error
Runtime error
Commit
·
f33f649
1
Parent(s):
55d3c49
deleted unnecessary helper methods for instructor interface
Browse files
app.py
CHANGED
@@ -11,22 +11,7 @@ def get_tutor_reply(chat_tutor):
|
|
11 |
|
12 |
def get_conversation_history(chat_tutor):
|
13 |
return chat_tutor.conversation_memory, chat_tutor
|
14 |
-
|
15 |
-
### Instructor Interface Helper Functions ###
|
16 |
-
def get_instructor_prompt(fileobj):
|
17 |
-
# get file path
|
18 |
-
file_path = fileobj.name
|
19 |
-
with open(file_path, "r") as f:
|
20 |
-
instructor_prompt = f.read()
|
21 |
-
return instructor_prompt
|
22 |
|
23 |
-
def embed_prompt(prompt, chat_tutor):
|
24 |
-
# update secret
|
25 |
-
os.environ["SECRET_PROMPT"] = prompt
|
26 |
-
# update tutor
|
27 |
-
chat_tutor.learning_objectives = prompt
|
28 |
-
return os.environ.get("SECRET_PROMPT"), chat_tutor
|
29 |
-
|
30 |
### User Interfaces ###
|
31 |
with gr.Blocks() as demo:
|
32 |
#initialize tutor (with state)
|
|
|
11 |
|
12 |
def get_conversation_history(chat_tutor):
|
13 |
return chat_tutor.conversation_memory, chat_tutor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
### User Interfaces ###
|
16 |
with gr.Blocks() as demo:
|
17 |
#initialize tutor (with state)
|