Spaces:
Running
Running
Commit
·
29d9b62
1
Parent(s):
3b1dde8
Upload app.py
Browse files
app.py
CHANGED
@@ -518,8 +518,6 @@ class Reader:
|
|
518 |
reraise=True)
|
519 |
def chat_conclusion(self, text, key):
|
520 |
openai.api_key = key
|
521 |
-
self.cur_api += 1
|
522 |
-
self.cur_api = 0 if self.cur_api >= len(self.chat_api_list)-1 else self.cur_api
|
523 |
conclusion_prompt_token = 650
|
524 |
text_token = len(self.encoding.encode(text))
|
525 |
clip_text_index = int(len(text)*(self.max_token_num-conclusion_prompt_token)/text_token)
|
@@ -565,8 +563,6 @@ class Reader:
|
|
565 |
reraise=True)
|
566 |
def chat_method(self, text, key):
|
567 |
openai.api_key = key
|
568 |
-
self.cur_api += 1
|
569 |
-
self.cur_api = 0 if self.cur_api >= len(self.chat_api_list)-1 else self.cur_api
|
570 |
method_prompt_token = 650
|
571 |
text_token = len(self.encoding.encode(text))
|
572 |
clip_text_index = int(len(text)*(self.max_token_num-method_prompt_token)/text_token)
|
@@ -614,8 +610,6 @@ class Reader:
|
|
614 |
reraise=True)
|
615 |
def chat_summary(self, text, key):
|
616 |
openai.api_key = key
|
617 |
-
self.cur_api += 1
|
618 |
-
self.cur_api = 0 if self.cur_api >= len(self.chat_api_list)-1 else self.cur_api
|
619 |
summary_prompt_token = 1000
|
620 |
text_token = len(self.encoding.encode(text))
|
621 |
clip_text_index = int(len(text)*(self.max_token_num-summary_prompt_token)/text_token)
|
|
|
518 |
reraise=True)
|
519 |
def chat_conclusion(self, text, key):
|
520 |
openai.api_key = key
|
|
|
|
|
521 |
conclusion_prompt_token = 650
|
522 |
text_token = len(self.encoding.encode(text))
|
523 |
clip_text_index = int(len(text)*(self.max_token_num-conclusion_prompt_token)/text_token)
|
|
|
563 |
reraise=True)
|
564 |
def chat_method(self, text, key):
|
565 |
openai.api_key = key
|
|
|
|
|
566 |
method_prompt_token = 650
|
567 |
text_token = len(self.encoding.encode(text))
|
568 |
clip_text_index = int(len(text)*(self.max_token_num-method_prompt_token)/text_token)
|
|
|
610 |
reraise=True)
|
611 |
def chat_summary(self, text, key):
|
612 |
openai.api_key = key
|
|
|
|
|
613 |
summary_prompt_token = 1000
|
614 |
text_token = len(self.encoding.encode(text))
|
615 |
clip_text_index = int(len(text)*(self.max_token_num-summary_prompt_token)/text_token)
|