Ahahajij182u2 commited on
Commit
4fa26df
1 Parent(s): b1f2afe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -1,15 +1,11 @@
1
  import gradio as gr
2
- import os
3
- import time
4
  import google.generativeai as genai
5
- import re
6
-
7
-
8
- genai.configure(api_key="AIzaSyCHxt5i3nism2Tj5xSUWdLVG5FtiEbtwiM")
9
 
 
10
  def to_markdown(text):
11
- text = re.sub(r"\*{2}(.*?)\*{2}|_{2}(.*?)_{2}", r"\1", text)
12
- text = re.sub(r"\*(.*?)\*|_(.*?)_", r"\1", text)
13
  text = re.sub(r"`(.*?)`", r"\1", text)
14
  text = re.sub(r'^#{1,6} ', '', text, flags=re.MULTILINE)
15
  return text
 
1
  import gradio as gr
2
+ import os import time
 
3
  import google.generativeai as genai
4
+ import re
 
 
 
5
 
6
+ genai.configure(api_key=os.environ.get('gemini_key'))
7
  def to_markdown(text):
8
+ text = re.sub(r"\*{2}(.*?)\*{2}|_{2}(.*?)_{2}", r"\1", text) text = re.sub(r"\*(.*?)\*|_(.*?)_", r"\1", text)
 
9
  text = re.sub(r"`(.*?)`", r"\1", text)
10
  text = re.sub(r'^#{1,6} ', '', text, flags=re.MULTILINE)
11
  return text