MatheusHRV commited on
Commit
87140b4
1 Parent(s): e215e00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -9
app.py CHANGED
@@ -1,25 +1,18 @@
1
- #Hello! It seems like you want to import the Streamlit library in Python. Streamlit is a powerful open-source framework used for building web applications with interactive data visualizations and machine learning models. To import Streamlit, you'll need to ensure that you have it installed in your Python environment.
2
- #Once you have Streamlit installed, you can import it into your Python script using the import statement,
3
 
4
  import streamlit as st
5
 
6
  from langchain.llms import OpenAI
7
 
8
- #When deployed on huggingface spaces, this values has to be passed using Variables & Secrets setting, as shown in the video :)
9
- #import os
10
- #os.environ["OPENAI_API_KEY"] = "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"
11
-
12
  #Function to return the response
13
  def load_answer(question):
14
- # "text-davinci-003" model is depreciated, so using the latest one https://platform.openai.com/docs/deprecations
15
  llm = OpenAI(model_name="gpt-3.5-turbo-instruct",temperature=0)
16
  answer=llm(question)
17
  return answer
18
 
19
 
20
  #App UI starts here
21
- st.set_page_config(page_title="LangChain Demo", page_icon=":robot:")
22
- st.header("LangChain Demo")
23
 
24
  #Gets the user input
25
  def get_text():
 
 
 
1
 
2
  import streamlit as st
3
 
4
  from langchain.llms import OpenAI
5
 
 
 
 
 
6
  #Function to return the response
7
  def load_answer(question):
 
8
  llm = OpenAI(model_name="gpt-3.5-turbo-instruct",temperature=0)
9
  answer=llm(question)
10
  return answer
11
 
12
 
13
  #App UI starts here
14
+ st.set_page_config(page_title="IPE Q&A Demo", page_icon=":robot:")
15
+ st.header("Q&A Demo")
16
 
17
  #Gets the user input
18
  def get_text():