TypeError: predict() got an unexpected keyword argument 'message'

#2
by vampire29 - opened

client = Client("gokaygokay/Gemma-2-llamacpp")

# View the API details
api_info = client.view_api()
print(api_info)

Console output:

Client.predict() Usage Info
---------------------------
Named API endpoints: 1

 - predict(message, model, system_message, max_tokens, temperature, topp, topk, repetition_penalty, api_name="/chat") -> message
    Parameters:
     - [Textbox] message: str 
     - [Dropdown] model: Literal['gemma-2-9b-it-Q5_K_M.gguf', 'gemma-2-27b-it-Q5_K_M.gguf'] 
     - [Textbox] system_message: str 
     - [Slider] max_tokens: float (numeric value between 1 and 4096) 
     - [Slider] temperature: float (numeric value between 0.1 and 4.0) 
     - [Slider] topp: float (numeric value between 0.1 and 1.0) 
     - [Slider] topk: float (numeric value between 0 and 100) 
     - [Slider] repetition_penalty: float (numeric value between 0.0 and 2.0) 
    Returns:
     - [Textbox] message: str 

None

But, trying the following code:

from gradio_client import Client

client = Client("gokaygokay/Gemma-2-llamacpp")
result = client.predict(message="Hello!!",model="gemma-2-27b-it-Q5_K_M.gguf",system_message="You are a helpful assistant.",max_tokens=2048,temperature=0.7,top_p=0.95,top_k=40,repeat_penalty=1.1,api_name="/chat")
print(result)

gives console output:

Loaded as API: https://gokaygokay-gemma-2-llamacpp.hf.space ✔
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[26], line 4
      1 from gradio_client import Client
      3 client = Client("gokaygokay/Gemma-2-llamacpp")
----> 4 result = client.predict(message="Hello!!",model="gemma-2-27b-it-Q5_K_M.gguf",system_message="You are a helpful assistant.",max_tokens=2048,temperature=0.7,top_p=0.95,top_k=40,repeat_penalty=1.1,api_name="/chat")
      5 print(result)

TypeError: predict() got an unexpected keyword argument 'message'

Sign up or log in to comment