Spaces:
Sleeping
Sleeping
Synced repo using 'sync_with_huggingface' Github Action
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import parsing
|
|
3 |
from custom_prompt import TexRestructureTemplate,MetadataTemplate
|
4 |
import ast
|
5 |
from gpt import get_chat_completion
|
6 |
-
|
7 |
|
8 |
|
9 |
def main():
|
@@ -68,12 +68,13 @@ def main():
|
|
68 |
|
69 |
# Get the link input from the user
|
70 |
link = st.text_input("Enter the link to the JEE Main physics question:")
|
71 |
-
|
72 |
if st.button("Submit"):
|
73 |
if link:
|
74 |
try:
|
75 |
ques,ans = parsing.parse(link)
|
76 |
print("Checkpoint-1")
|
|
|
77 |
restructure_prompt = TexRestructureTemplate()
|
78 |
q_restruct_prompt = restructure_prompt.format(content=ques)
|
79 |
question = get_chat_completion(q_restruct_prompt)
|
|
|
3 |
from custom_prompt import TexRestructureTemplate,MetadataTemplate
|
4 |
import ast
|
5 |
from gpt import get_chat_completion
|
6 |
+
import openai
|
7 |
|
8 |
|
9 |
def main():
|
|
|
68 |
|
69 |
# Get the link input from the user
|
70 |
link = st.text_input("Enter the link to the JEE Main physics question:")
|
71 |
+
openAiKey = st.text_input(label="Input the openai key", type="password")
|
72 |
if st.button("Submit"):
|
73 |
if link:
|
74 |
try:
|
75 |
ques,ans = parsing.parse(link)
|
76 |
print("Checkpoint-1")
|
77 |
+
openai.api_key = openAiKey
|
78 |
restructure_prompt = TexRestructureTemplate()
|
79 |
q_restruct_prompt = restructure_prompt.format(content=ques)
|
80 |
question = get_chat_completion(q_restruct_prompt)
|