hellofinch il y a 1 an
Parent
commit
0a73e8051f
1 fichiers modifiés avec 3 ajouts et 5 suppressions
  1. 3 5
      pdf2zh/translator.py

+ 3 - 5
pdf2zh/translator.py

@@ -157,12 +157,10 @@ class DeepLXTranslator(BaseTranslator):
         super().__init__(service, lang_out, lang_in, model)
         self.endpoint = os.getenv("DEEPLX_ENDPOINT", self.envs["DEEPLX_ENDPOINT"])
         self.session = requests.Session()
-        auth_key=os.getenv("DEEPLX_AUTH_KEY", self.envs["DEEPLX_AUTH_KEY"])
-        self.header={
-            "Content-Type": "application/json"
-        }
+        auth_key = os.getenv("DEEPLX_AUTH_KEY", self.envs["DEEPLX_AUTH_KEY"])
+        self.header = {"Content-Type": "application/json"}
         if auth_key:
-            self.header["Authorization"]= auth_key
+            self.header["Authorization"] = auth_key
 
     def translate(self, text):
         resp = self.session.post(