fruitpicker01 commited on
Commit
fdfe0bc
·
verified ·
1 Parent(s): 7f1566f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -31,8 +31,8 @@ client = Together(api_key=TOGETHER_API_KEY)
31
 
32
  # Авторизация в сервисе GigaChat
33
  chat_pro = GigaChat(credentials=gc_key, model='GigaChat-Pro', max_tokens=68, temperature=1, verify_ssl_certs=False)
34
- chat_lite = GigaChat(credentials=gc_key, model='GigaChat', max_tokens=68, temperature=1, verify_ssl_certs=False)
35
- chat_plus = GigaChat(credentials=gc_key, model='GigaChat-Plus', max_tokens=68, temperature=1, verify_ssl_certs=False)
36
 
37
  # Экземпляры моделей для объяснений
38
  chat_pro_explain = GigaChat(credentials=gc_key, model='GigaChat-Pro', temperature=1, verify_ssl_certs=False)
@@ -471,8 +471,8 @@ def correct_dash_usage(text):
471
  text = re.sub(r'"([^\"]+)"', r'«\1»', text)
472
 
473
  # Step 5: Remove single quotes
474
- if text.count('«') != text.count('»'):
475
- text = text.replace('«', '').replace('»', '')
476
 
477
  # Step 6: Replace 100k with 100 000
478
  text = re.sub(r'(\d+)[kкКK]', r'\1 000', text, flags=re.IGNORECASE)
 
31
 
32
  # Авторизация в сервисе GigaChat
33
  chat_pro = GigaChat(credentials=gc_key, model='GigaChat-Pro', max_tokens=68, temperature=1, verify_ssl_certs=False)
34
+ chat_lite = GigaChat(credentials=gc_key, model='GigaChat', max_tokens=68, temperature=1.1, verify_ssl_certs=False)
35
+ chat_plus = GigaChat(credentials=gc_key, model='GigaChat-Plus', max_tokens=68, temperature=1.1, verify_ssl_certs=False)
36
 
37
  # Экземпляры моделей для объяснений
38
  chat_pro_explain = GigaChat(credentials=gc_key, model='GigaChat-Pro', temperature=1, verify_ssl_certs=False)
 
471
  text = re.sub(r'"([^\"]+)"', r'«\1»', text)
472
 
473
  # Step 5: Remove single quotes
474
+ if text.count('"') == 1:
475
+ text = text.replace('"', '')
476
 
477
  # Step 6: Replace 100k with 100 000
478
  text = re.sub(r'(\d+)[kкКK]', r'\1 000', text, flags=re.IGNORECASE)