diff options
author | kqlio67 <kqlio67@users.noreply.github.com> | 2024-11-11 09:36:56 +0100 |
---|---|---|
committer | kqlio67 <kqlio67@users.noreply.github.com> | 2024-11-11 09:36:56 +0100 |
commit | c74a6943a8bc03a212643e430a1b873da89f81a6 (patch) | |
tree | c84d4caa70cdcae56361a8c33c51f021b46d8357 /g4f | |
parent | Update (g4f/Provider/airforce/AirforceChat.py) (diff) | |
download | gpt4free-c74a6943a8bc03a212643e430a1b873da89f81a6.tar gpt4free-c74a6943a8bc03a212643e430a1b873da89f81a6.tar.gz gpt4free-c74a6943a8bc03a212643e430a1b873da89f81a6.tar.bz2 gpt4free-c74a6943a8bc03a212643e430a1b873da89f81a6.tar.lz gpt4free-c74a6943a8bc03a212643e430a1b873da89f81a6.tar.xz gpt4free-c74a6943a8bc03a212643e430a1b873da89f81a6.tar.zst gpt4free-c74a6943a8bc03a212643e430a1b873da89f81a6.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/Provider/Cloudflare.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/g4f/Provider/Cloudflare.py b/g4f/Provider/Cloudflare.py index 2443f616..34d7c585 100644 --- a/g4f/Provider/Cloudflare.py +++ b/g4f/Provider/Cloudflare.py @@ -21,10 +21,7 @@ class Cloudflare(AsyncGeneratorProvider, ProviderModelMixin): supports_message_history = True default_model = '@cf/meta/llama-3.1-8b-instruct-awq' - models = [ - '@cf/tiiuae/falcon-7b-instruct', # Specific answer - - + models = [ '@hf/google/gemma-7b-it', '@cf/meta/llama-2-7b-chat-fp16', @@ -120,9 +117,12 @@ class Cloudflare(AsyncGeneratorProvider, ProviderModelMixin): scraper = cloudscraper.create_scraper() + + prompt = messages[-1]['content'] + data = { "messages": [ - {"role": "user", "content": format_prompt(messages)} + {"role": "user", "content": prompt} ], "lora": None, "model": model, @@ -147,7 +147,7 @@ class Cloudflare(AsyncGeneratorProvider, ProviderModelMixin): response.raise_for_status() - skip_tokens = ["</s>", "<s>", "[DONE]", "<|endoftext|>", "<|end|>"] + skip_tokens = ["</s>", "<s>", "</s>", "[DONE]", "<|endoftext|>", "<|end|>"] filtered_response = "" for line in response.iter_lines(): |