koler commited on
Commit
6d9a17c
·
verified ·
1 Parent(s): 23b6243

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -8,9 +8,9 @@ import os
8
  #load API key
9
  os.environ["GOOGLE_API_KEY"] = os.environ.get("GOOGLE_API_KEY")
10
 
11
- #use correct model name
12
  model = ChatGoogleGenerativeAI(
13
- model="gemini-pro", # or "gemini-1.5-flash" if verified and working
14
  temperature=0.5
15
  )
16
 
@@ -22,10 +22,10 @@ template = PromptTemplate(
22
 
23
  parser = StrOutputParser()
24
 
25
- # Create the chain
26
  chain = template | model | parser
27
 
28
- # Define the function for Gradio
29
  def generate_facts(topic):
30
  try:
31
  result = chain.invoke({'topic': topic})
 
8
  #load API key
9
  os.environ["GOOGLE_API_KEY"] = os.environ.get("GOOGLE_API_KEY")
10
 
11
+ #here using of the Google Model because for me huggingface model is not working, due to some api issue.
12
  model = ChatGoogleGenerativeAI(
13
+ model="models/gemini-1.5-flash-latest",
14
  temperature=0.5
15
  )
16
 
 
22
 
23
  parser = StrOutputParser()
24
 
25
+ # create the chain
26
  chain = template | model | parser
27
 
28
+ # now creating of the gradio app
29
  def generate_facts(topic):
30
  try:
31
  result = chain.invoke({'topic': topic})