Skip to content

Commit

Permalink
change message
Browse files Browse the repository at this point in the history
  • Loading branch information
Linh-nk committed Oct 1, 2024
1 parent 7e57127 commit 9ecd5fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion sigllm/primitives/prompting/gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def detect(self, X, **kwargs):

all_responses, all_probs = [], []
for text in tqdm(X):
message = ' '.join(PROMPTS['user_message'], text[0], self.sep)
message = ' '.join(PROMPTS['user_message'], text, self.sep)
response = openai.ChatCompletion.create(
model=self.name,
messages=[
Expand Down
11 changes: 4 additions & 7 deletions sigllm/primitives/prompting/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,10 @@ def detect(self, X, **kwargs):
all_responses, all_generate_ids = [], []

for text in tqdm(X):
text = text.flatten().tolist()
message = [
' '.join(
(PROMPTS['system_message'],
PROMPTS['user_message'],
x,
'[RESPONSE]')) for x in text]
message = ' '.join(PROMPTS['system_message'],
PROMPTS['user_message'],
text,
'[RESPONSE]')

input_length = len(self.tokenizer.encode(message[0]))

Expand Down

0 comments on commit 9ecd5fa

Please sign in to comment.