nexusraven

| 选择喜欢的代码风格  

nexusraven 参数量


13b
 

nexusraven 模型介绍



nexusraven Models

Nexus Raven 是一个拥有 130 亿个参数的模型,专为函数调用任务而设计。

NexusRaven-V2 是一个经过更新的开源且具有商业可行性的函数调用模型:

  • 强大的函数调用能力:能够在多种挑战性情况下生成单函数调用、嵌套调用和并行调用。
  • 完全可解释:能够为其生成的函数调用生成非常详细的解释。此行为可以关闭,以便在推理过程中节省 token。
  • 性能亮点:在涉及嵌套函数和复合函数的人工生成用例中,函数调用成功率比 GPT-4 高出高达 7%。
  • 泛化至未知领域:从未对评估中使用的函数进行过训练。
  • 商业许可:训练不涉及任何由 GPT-4 等专有 LLM 生成的数据。在商业应用中部署时,您可以完全控制模型。

 

ollama CLI 调用 nexusraven


ollama run nexusraven
 

在 GPU 上运行 nexusraven 模型


# Please `pip install transformers accelerate`
from transformers import pipeline


pipeline = pipeline(
    "text-generation",
    model="Nexusflow/NexusRaven-V2-13B",
    torch_dtype="auto",
    device_map="auto",
)

prompt_template = \
'''
Function:
def get_weather_data(coordinates):
    """
    Fetches weather data from the Open-Meteo API for the given latitude and longitude.

    Args:
    coordinates (tuple): The latitude of the location.

    Returns:
    float: The current temperature in the coordinates you've asked for
    """

Function:
def get_coordinates_from_city(city_name):
    """
    Fetches the latitude and longitude of a given city name using the Maps.co Geocoding API.

    Args:
    city_name (str): The name of the city.

    Returns:
    tuple: The latitude and longitude of the city.
    """

User Query: {query}<human_end>

'''

prompt = prompt_template.format(query="What's the weather like in Seattle right now?")

result = pipeline(prompt, max_new_tokens=2048, return_full_text=False, do_sample=False, temperature=0.001)[0]["generated_text"]
print (result)
 

AI 扩展阅读:




发表评论