GlitchGhost commited on
Commit
ed4512a
1 Parent(s): 7abd334

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -50
app.py DELETED
@@ -1,50 +0,0 @@
1
- # Q&A Chatbot
2
- #from langchain.llms import OpenAI
3
-
4
- from dotenv import load_dotenv
5
-
6
- load_dotenv() # take environment variables from .env.
7
-
8
- import streamlit as st
9
- import os
10
- import pathlib
11
- import textwrap
12
-
13
- import google.generativeai as genai
14
-
15
- from IPython.display import display
16
- from IPython.display import Markdown
17
-
18
-
19
- def to_markdown(text):
20
- text = text.replace('•', ' *')
21
- return Markdown(textwrap.indent(text, '> ', predicate=lambda _: True))
22
-
23
- os.getenv("GOOGLE_API_KEY")
24
- genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
25
-
26
- ## Function to load OpenAI model and get respones
27
-
28
- def get_gemini_response(question):
29
- model = genai.GenerativeModel('gemini-pro')
30
- response = model.generate_content(question)
31
- return response.text
32
-
33
- ##initialize our streamlit app
34
-
35
- st.set_page_config(page_title="Q&A Demo")
36
-
37
- st.header("Gemini Application")
38
-
39
- input=st.text_input("Input: ",key="input")
40
-
41
-
42
- submit=st.button("Ask the question")
43
-
44
- ## If ask button is clicked
45
-
46
- if submit:
47
-
48
- response=get_gemini_response(input)
49
- st.subheader("The Response is")
50
- st.write(response)