bdss58 lijianyong commited on
Commit
5c2094e
·
1 Parent(s): 2d45930

Feat stepfun (#1659)

Browse files

### What problem does this PR solve?

#1661
#1660

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

---------

Co-authored-by: lijianyong <lijianyong@stepfun.com>

Files changed (2) hide show
  1. conf/llm_factories.json +7 -1
  2. rag/llm/chat_model.py +2 -3
conf/llm_factories.json CHANGED
@@ -1895,7 +1895,7 @@
1895
  "llm": [
1896
  {
1897
  "llm_name": "step-1-8k",
1898
- "tags": "LLM,CHAT,15k",
1899
  "max_tokens": 8192,
1900
  "model_type": "chat"
1901
  },
@@ -1916,6 +1916,12 @@
1916
  "tags": "LLM,CHAT,256k",
1917
  "max_tokens": 262144,
1918
  "model_type": "chat"
 
 
 
 
 
 
1919
  }
1920
  ]
1921
  },
 
1895
  "llm": [
1896
  {
1897
  "llm_name": "step-1-8k",
1898
+ "tags": "LLM,CHAT,8k",
1899
  "max_tokens": 8192,
1900
  "model_type": "chat"
1901
  },
 
1916
  "tags": "LLM,CHAT,256k",
1917
  "max_tokens": 262144,
1918
  "model_type": "chat"
1919
+ },
1920
+ {
1921
+ "llm_name": "step-1v-8k",
1922
+ "tags": "LLM,CHAT,IMAGE2TEXT",
1923
+ "max_tokens": 8000,
1924
+ "model_type": "image2text"
1925
  }
1926
  ]
1927
  },
rag/llm/chat_model.py CHANGED
@@ -85,7 +85,6 @@ class MoonshotChat(Base):
85
  if not base_url: base_url="https://api.moonshot.cn/v1"
86
  super().__init__(key, model_name, base_url)
87
 
88
-
89
  class XinferenceChat(Base):
90
  def __init__(self, key=None, model_name="", base_url=""):
91
  key = "xxx"
@@ -898,9 +897,9 @@ class OpenRouterChat(Base):
898
  self.model_name = model_name
899
 
900
  class StepFunChat(Base):
901
- def __init__(self, key, model_name, base_url="https://api.stepfun.com/v1/chat/completions"):
902
  if not base_url:
903
- base_url = "https://api.stepfun.com/v1/chat/completions"
904
  super().__init__(key, model_name, base_url)
905
 
906
 
 
85
  if not base_url: base_url="https://api.moonshot.cn/v1"
86
  super().__init__(key, model_name, base_url)
87
 
 
88
  class XinferenceChat(Base):
89
  def __init__(self, key=None, model_name="", base_url=""):
90
  key = "xxx"
 
897
  self.model_name = model_name
898
 
899
  class StepFunChat(Base):
900
+ def __init__(self, key, model_name, base_url="https://api.stepfun.com/v1"):
901
  if not base_url:
902
+ base_url = "https://api.stepfun.com/v1"
903
  super().__init__(key, model_name, base_url)
904
 
905