siddhantuniyal commited on
Commit
06cf59e
1 Parent(s): 05d34e2

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +27 -0
  2. requirements.txt +1 -0
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import google.generativeai as genai
2
+ import gradio as gr
3
+
4
+ api_key = "AIzaSyAMfftpsTHFJx-4xhoOAKCM-Uc42SKOb98"
5
+
6
+ model = genai.GenerativeModel('gemini-pro')
7
+ genai.configure(api_key = api_key)
8
+ chat = model.start_chat(history=[])
9
+ temp = chat.send_message(f"""
10
+ You are an expert lecture notes designer LLM. Your task is to take a transcript of a lecture,
11
+ and turn it into notes. You will receive transcripts of lectures based on Physics , Chemistry and Mathematics.""")
12
+
13
+ def generate_notes(prompt):
14
+ input = "Generate lecture notes from this transcript. Please make sure to fully understand this transcript first, and then generate the notes.\n" + prompt
15
+ output = chat.send_message(input)
16
+ return output.text
17
+
18
+ iface = gr.Interface(
19
+ fn= generate_notes,
20
+ inputs= "text",
21
+ outputs= "text",
22
+ title="Aeravat Note Generation",
23
+ )
24
+
25
+
26
+ # Launch the Gradio interface
27
+ iface.launch(share=True)
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ gradio