Snigdhapaul2003 commited on
Commit
bfc7307
·
verified ·
1 Parent(s): 43b1e53

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -9
app.py CHANGED
@@ -12,8 +12,8 @@ import google.generativeai as genai
12
  import tempfile
13
 
14
 
15
- GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
16
- GROQ_API_KEY = os.getenv("GROQ_API_KEY")
17
 
18
  genai.configure(api_key=GOOGLE_API_KEY)
19
  model = genai.GenerativeModel('gemini-2.0-flash-thinking-exp-01-21')
@@ -103,12 +103,9 @@ def process_pdfs_and_generate_question_paper(uploaded_files, name, number_of_sec
103
 
104
  # Simulate question paper generation (replace with actual API call)
105
  prompt = f"""
106
- Based on the content provided below, please generate a well-structured {calculated_marks}-mark question paper. The paper should consist of the following:
107
-
108
  {question_distribution}
109
-
110
  The total mark distribution should be strictly adhered to, with no question exceeding the specified marks.
111
-
112
  - The difficulty level of the paper should be {difficulty_level} on a scale of 5, meaning the questions should be tricky and require in-depth understanding.
113
  - Ensure no repetition of questions or concepts throughout the paper.
114
  - Include critical mathematical problems wherever relevant, and feel free to create challenging new problems of a similar type to the ones presented in the content.
@@ -116,9 +113,7 @@ def process_pdfs_and_generate_question_paper(uploaded_files, name, number_of_sec
116
  - Each question will be versatile in concept.
117
  - Some of the questions will be application based, which the student need to think critically before answering.
118
  - Some questions will be conceptual to test students concept depth.
119
-
120
  The questions should not be overly simple, and they should test the understanding and application of concepts, not just recall. Maintain a high standard throughout the paper.
121
-
122
  Content:
123
  \n\n{full_ocr_text}
124
  """
@@ -253,4 +248,4 @@ def generate_interface():
253
  return demo
254
 
255
  demo = generate_interface()
256
- demo.launch(share = True)
 
12
  import tempfile
13
 
14
 
15
+ GOOGLE_API_KEY = "AIzaSyBEtOsNm1I8YdsQSDjF8SauSQwiGzvDHLY"
16
+ GROQ_API_KEY = "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"
17
 
18
  genai.configure(api_key=GOOGLE_API_KEY)
19
  model = genai.GenerativeModel('gemini-2.0-flash-thinking-exp-01-21')
 
103
 
104
  # Simulate question paper generation (replace with actual API call)
105
  prompt = f"""
106
+ Based on the content provided below, please generate a well-structured {calculated_marks}-mark question paper in English. The paper should consist of the following:
 
107
  {question_distribution}
 
108
  The total mark distribution should be strictly adhered to, with no question exceeding the specified marks.
 
109
  - The difficulty level of the paper should be {difficulty_level} on a scale of 5, meaning the questions should be tricky and require in-depth understanding.
110
  - Ensure no repetition of questions or concepts throughout the paper.
111
  - Include critical mathematical problems wherever relevant, and feel free to create challenging new problems of a similar type to the ones presented in the content.
 
113
  - Each question will be versatile in concept.
114
  - Some of the questions will be application based, which the student need to think critically before answering.
115
  - Some questions will be conceptual to test students concept depth.
 
116
  The questions should not be overly simple, and they should test the understanding and application of concepts, not just recall. Maintain a high standard throughout the paper.
 
117
  Content:
118
  \n\n{full_ocr_text}
119
  """
 
248
  return demo
249
 
250
  demo = generate_interface()
251
+ demo.launch(share = True)