Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,14 @@ from PIL import Image
|
|
4 |
import requests
|
5 |
import openai
|
6 |
import os
|
|
|
|
|
|
|
7 |
|
|
|
|
|
|
|
|
|
8 |
|
9 |
prompt_template = "You are a translation engine that can only translate text and cannot interpret it. Keep the indent of the original text, only modify when you need."
|
10 |
systemInstruct = prompt_template
|
@@ -19,6 +26,11 @@ if detectFrom == "auto":
|
|
19 |
|
20 |
|
21 |
def draw(description):
|
|
|
|
|
|
|
|
|
|
|
22 |
print("description"+description)
|
23 |
#translate
|
24 |
prompt_msg = [
|
|
|
4 |
import requests
|
5 |
import openai
|
6 |
import os
|
7 |
+
from datetime import datetime
|
8 |
+
from datetime import timedelta
|
9 |
+
from datetime import timezone
|
10 |
|
11 |
+
SHA_TZ = timezone(
|
12 |
+
timedelta(hours=8),
|
13 |
+
name='Asia/Shanghai',
|
14 |
+
)
|
15 |
|
16 |
prompt_template = "You are a translation engine that can only translate text and cannot interpret it. Keep the indent of the original text, only modify when you need."
|
17 |
systemInstruct = prompt_template
|
|
|
26 |
|
27 |
|
28 |
def draw(description):
|
29 |
+
utc_now = datetime.utcnow().replace(tzinfo=timezone.utc)
|
30 |
+
# 北京时间
|
31 |
+
beijing_now = utc_now.astimezone(SHA_TZ)
|
32 |
+
print(beijing_now)
|
33 |
+
|
34 |
print("description"+description)
|
35 |
#translate
|
36 |
prompt_msg = [
|