Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,12 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image
|
| 3 |
import google.generativeai as genai
|
| 4 |
-
from IPython.display import Markdown
|
| 5 |
|
| 6 |
api_key = 'AIzaSyB7-RzBwTAfVA-7ZGk2mEOQwOxshpwzhpM' # put your API key here
|
| 7 |
genai.configure(api_key=api_key)
|
| 8 |
geminiModel = genai.GenerativeModel(model_name='gemini-pro-vision')
|
| 9 |
title="DocTR OCR (PDL Demo)"
|
| 10 |
description="Upload an image to get the OCR results !"
|
| 11 |
-
|
| 12 |
-
def to_markdown(text):
|
| 13 |
-
text = text.replace('•', ' *')
|
| 14 |
-
return Markdown(textwrap.indent(text, '> ', predicate=lambda _: True))
|
| 15 |
|
| 16 |
def greet(img):
|
| 17 |
# generate text
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image
|
| 3 |
import google.generativeai as genai
|
|
|
|
| 4 |
|
| 5 |
api_key = 'AIzaSyB7-RzBwTAfVA-7ZGk2mEOQwOxshpwzhpM' # put your API key here
|
| 6 |
genai.configure(api_key=api_key)
|
| 7 |
geminiModel = genai.GenerativeModel(model_name='gemini-pro-vision')
|
| 8 |
title="DocTR OCR (PDL Demo)"
|
| 9 |
description="Upload an image to get the OCR results !"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
def greet(img):
|
| 12 |
# generate text
|