Update app/main.py
Browse files- app/main.py +7 -3
app/main.py
CHANGED
@@ -64,9 +64,13 @@ def process(image_pil):
|
|
64 |
image_pil.save(buf, format="PNG")
|
65 |
image_bytes = buf.getvalue()
|
66 |
|
67 |
-
token = get_access_token(BAIDU_API_KEY, BAIDU_SECRET_KEY)
|
68 |
-
words = ocr_image(image_bytes, token)
|
69 |
-
essay_text = "\n".join([w["words"] for w in words])
|
|
|
|
|
|
|
|
|
70 |
|
71 |
# 1. 格式化原文
|
72 |
fmt_prompt = (
|
|
|
64 |
image_pil.save(buf, format="PNG")
|
65 |
image_bytes = buf.getvalue()
|
66 |
|
67 |
+
#token = get_access_token(BAIDU_API_KEY, BAIDU_SECRET_KEY)
|
68 |
+
#words = ocr_image(image_bytes, token)
|
69 |
+
#essay_text = "\n".join([w["words"] for w in words])
|
70 |
+
essay_text = """
|
71 |
+
I hurried into the theater, only to find there were even more bikers inside. At that moment, I couldn’t believe my eyes, with my mind immediately getting blank and my mouth opening wide. So frozen and still at the theater gate was I, which made the bikers inside all throw/cast their gazes on me that I felt nothing but my heart pounding even more strongly, completely unaware of what action I would adopt. I was not sure how much time had passed, but only greeted by each of the biker coming in from the outside who I had encountered in the deserted street. Suddenly, the curtain opened.
|
72 |
+
When the film began, I realized that the bikers were an animal rescue group. With a start, recalling how ridiculous my overreaction had been instantly helped me no longer feel dangerous. Naturally, by the light from the film, I found a seat and sat next to a tough-look biker. After a short conversation with him, I expressed my wish to save abandoned dogs. Hearing this, he enthusiastically welcomed me to join the animal rescue group. Then, with the film ending, he introduced me to all the members. Seeing so many animal lovers around, I did believe we would find a way to help the wild live with us harmoniously together.
|
73 |
+
"""
|
74 |
|
75 |
# 1. 格式化原文
|
76 |
fmt_prompt = (
|