Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for replicate [code in ticket] #4

Closed
krrishdholakia opened this issue Jul 28, 2023 · 1 comment
Closed

Add support for replicate [code in ticket] #4

krrishdholakia opened this issue Jul 28, 2023 · 1 comment

Comments

@krrishdholakia
Copy link
Contributor

Here's my code for replicate:

elif "replicate" in model: 
    prompt = " ".join([message["content"] for message in messages])
    output = replicate.run(
      model,
      input={
        "prompt": prompt,
      })
    print(f"output: {output}")
    response = ""
    for item in output: 
      print(f"item: {item}")
      response += item
    new_response = {
      "choices": [
        {
          "finish_reason": "stop",
          "index": 0,
          "message": {
              "content": response,
              "role": "assistant"
          }
        }
      ]
    }
    print(f"new response: {new_response}")
    response = new_response
@krrishdholakia krrishdholakia changed the title Add support for replicate [code in ticket Add support for replicate [code in ticket] Jul 28, 2023
@krrishdholakia
Copy link
Contributor Author

PR added - #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant