Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Update Provider API: Dfehub -> Zeabur
Browse files Browse the repository at this point in the history
  • Loading branch information
ramon-victor committed Jul 24, 2023
1 parent 865a868 commit 85809dc
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 38 deletions.
26 changes: 16 additions & 10 deletions client/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@
content="A conversational AI system that listens, learns, and challenges" />
<meta property="og:url" content="https://chat.acy.dev" />
<link rel="stylesheet" href="{{ url_for('bp.static', filename='css/style.css') }}" />
<link rel="apple-touch-icon" sizes="180x180" href="{{ url_for('bp.static', filename='img/apple-touch-icon.png') }}" />
<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('bp.static', filename='img/favicon-32x32.png') }}" />
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('bp.static', filename='img/favicon-16x16.png') }}" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="{{ url_for('bp.static', filename='img/apple-touch-icon.png') }}" />
<link
rel="icon"
type="image/png"
sizes="32x32"
href="{{ url_for('bp.static', filename='img/favicon-32x32.png') }}" />
<link
rel="icon"
type="image/png"
sizes="16x16"
href="{{ url_for('bp.static', filename='img/favicon-16x16.png') }}" />
<link rel="manifest" href="{{ url_for('bp.static', filename='img/site.webmanifest') }}" />
<link
rel="stylesheet"
Expand Down Expand Up @@ -44,9 +55,7 @@
</div>
<a class="info" href="https://github.com/ramonvc/gptfree-jailbreak-webui" target="_blank">
<i class="fa-brands fa-github"></i>
<span class="conversation-title">
Version: 0.0.10-Alpha
</span>
<span class="conversation-title"> Version: 0.0.10-Alpha </span>
</a>
</div>
</div>
Expand Down Expand Up @@ -76,11 +85,8 @@
<div class="field">
<select class="dropdown" name="model" id="model">
<option value="gpt-3.5-turbo" selected>GPT-3.5</option>
<option value="gpt-3.5-turbo-0613">GPT-3.5-0613</option>
<option value="gpt-3.5-turbo-0301">GPT-3.5-turbo-0301</option>
<option value="gpt-3.5-turbo-16k">GPT-3.5-turbo-16k</option>
<option value="gpt-3.5-turbo-16k-0613">
GPT-3.5-turbo-16k-0613
</option>
<option value="gpt-4">GPT-4</option>
</select>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
import requests
from ...typing import sha256, Dict, get_type_hints

url = "https://chat.dfehub.com"
model = ['gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-4']
url = "https://gptleg.zeabur.app"
model = ['gpt-3.5-turbo', 'gpt-3.5-turbo-0301',
'gpt-3.5-turbo-16k', 'gpt-4', 'gpt-4-0613']
supports_stream = True
needs_auth = False

Expand All @@ -18,8 +19,8 @@ def _create_completion(model: str, messages: list, stream: bool, **kwargs):
'Accept': 'text/event-stream',
'Accept-Language': 'pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7,zh-CN;q=0.6,zh;q=0.5',
'Content-Type': 'application/json',
'Origin': 'https://chat.dfehub.com',
'Referer': 'https://chat.dfehub.com/',
'Origin': 'https://gptleg.zeabur.app',
'Referer': 'https://gptleg.zeabur.app/',
'Sec-Ch-Ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"',
'Sec-Ch-Ua-Mobile': '?0',
'Sec-Ch-Ua-Platform': '"Windows"',
Expand All @@ -33,11 +34,11 @@ def _create_completion(model: str, messages: list, stream: bool, **kwargs):
data = {
'model': model,
'temperature': 0.7,
'max_tokens': '8000',
'max_tokens': '16000',
'presence_penalty': 0,
'messages': messages,
}

response = requests.post(url + '/api/openai/v1/chat/completions',
headers=headers, json=data, stream=stream)

Expand Down
2 changes: 1 addition & 1 deletion g4f/Provider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
ChatgptLogin,
ChatgptLogin,
DeepAi,
Dfehub,
Easychat,
Ezcht,
Fakeopen,
Expand All @@ -28,6 +27,7 @@
Xiaor,
Yqcloud,
You,
Zeabur
)

Palm = Bard
49 changes: 28 additions & 21 deletions g4f/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from g4f import Provider
import random


class Model:
class model:
name: str
Expand All @@ -15,17 +16,22 @@ class gpt_35_turbo:
class gpt_35_turbo_0613:
name: str = 'gpt-3.5-turbo-0613'
base_provider: str = 'openai'
best_provider: Provider.Provider = Provider.Gravityengine
best_provider: Provider.Provider = Provider.Zeabur

class gpt_35_turbo_0301:
name: str = 'gpt-3.5-turbo-0301'
base_provider: str = 'openai'
best_provider: Provider.Provider = Provider.Zeabur

class gpt_35_turbo_16k_0613:
name: str = 'gpt-3.5-turbo-16k-0613'
base_provider: str = 'openai'
best_provider: Provider.Provider = Provider.Gravityengine
best_provider: Provider.Provider = Provider.Zeabur

class gpt_35_turbo_16k:
name: str = 'gpt-3.5-turbo-16k'
base_provider: str = 'openai'
best_provider: Provider.Provider = Provider.Gravityengine
best_provider: Provider.Provider = Provider.Zeabur

class gpt_4_dev:
name: str = 'gpt-4-for-dev'
Expand All @@ -36,7 +42,7 @@ class gpt_4:
name: str = 'gpt-4'
base_provider: str = 'openai'
best_provider: Provider.Provider = Provider.ChatgptAi

class gpt_4_0613:
name: str = 'gpt-4-0613'
base_provider: str = 'openai'
Expand Down Expand Up @@ -152,79 +158,80 @@ class text_davinci_003:
name: str = 'text-davinci-003'
base_provider: str = 'openai'
best_provider: Provider.Provider = Provider.Vercel

class palm:
name: str = 'palm2'
base_provider: str = 'google'
best_provider: Provider.Provider = Provider.Bard



""" 'falcon-40b': Model.falcon_40b,
'falcon-7b': Model.falcon_7b,
'llama-13b': Model.llama_13b,"""

class falcon_40b:
name: str = 'falcon-40b'
base_provider: str = 'huggingface'
best_provider: Provider.Provider = Provider.H2o

class falcon_7b:
name: str = 'falcon-7b'
base_provider: str = 'huggingface'
best_provider: Provider.Provider = Provider.H2o

class llama_13b:
name: str = 'llama-13b'
base_provider: str = 'huggingface'
best_provider: Provider.Provider = Provider.H2o



class ModelUtils:
convert: dict = {
'gpt-3.5-turbo': Model.gpt_35_turbo,
'gpt-3.5-turbo-0613': Model.gpt_35_turbo_0613,
'gpt-3.5-turbo-0301': Model.gpt_35_turbo_0301,
'gpt-4': Model.gpt_4,
'gpt-4-0613': Model.gpt_4_0613,
'gpt-4-for-dev': Model.gpt_4_dev,
'gpt-3.5-turbo-16k': Model.gpt_35_turbo_16k,
'gpt-3.5-turbo-16k-0613': Model.gpt_35_turbo_16k_0613,

'claude-instant-v1-100k': Model.claude_instant_v1_100k,
'claude-v1-100k': Model.claude_v1_100k,
'claude-instant-v1': Model.claude_instant_v1,
'claude-v1': Model.claude_v1,

'alpaca-7b': Model.alpaca_7b,
'stablelm-tuned-alpha-7b': Model.stablelm_tuned_alpha_7b,

'bloom': Model.bloom,
'bloomz': Model.bloomz,

'flan-t5-xxl': Model.flan_t5_xxl,
'flan-ul2': Model.flan_ul2,

'gpt-neox-20b': Model.gpt_neox_20b,
'oasst-sft-4-pythia-12b-epoch-3.5': Model.oasst_sft_4_pythia_12b_epoch_35,
'santacoder': Model.santacoder,

'command-medium-nightly': Model.command_medium_nightly,
'command-xlarge-nightly': Model.command_xlarge_nightly,

'code-cushman-001': Model.code_cushman_001,
'code-davinci-002': Model.code_davinci_002,

'text-ada-001': Model.text_ada_001,
'text-babbage-001': Model.text_babbage_001,
'text-curie-001': Model.text_curie_001,
'text-davinci-002': Model.text_davinci_002,
'text-davinci-003': Model.text_davinci_003,

'palm2': Model.palm,
'palm': Model.palm,
'google': Model.palm,
'google-bard': Model.palm,
'google-palm': Model.palm,
'bard': Model.palm,

'falcon-40b': Model.falcon_40b,
'falcon-7b': Model.falcon_7b,
'llama-13b': Model.llama_13b,
Expand Down

0 comments on commit 85809dc

Please sign in to comment.