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 Mistral-7B model #283

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

jashdalvi
Copy link

Summary

This PR adds the Mistral-7B model to the xturing project:

  1. Features:

    • Added Mistral-7B-Instruct-v0.3 as the Mistral model.
    • Introduced the Mistral engine to support the new model.
  2. Documentation:

    • Updated README.md and docs to include information about the Mistral model.
    • Added examples for the Mistral model in the examples folder.
  3. Fixes:

    • Updated the transformers version to 4.40.0 to resolve issues with loading the Mistral model.
    • Added scipy to the dependencies list to support importing xturing.

Checklist

  • Tested
  • Documented

Additional Information

To validate the changes, you can use the following example code:

# Make the necessary imports
from xturing.models import Mistral

# Load the model
model = Mistral()
# Generate outputs from the model
outputs = model.generate(texts=["How are you?"])
# Print the generated outputs
print(outputs)

Expected output:

['\n\nI’m good, thank you for asking. It’s nice to hear from you.\n\nWhat have you been up to since we last spoke?\n\nWell, I’ve been keeping busy with work and trying to stay active. I’ve been going for walks and working out at home. How about you? What have you been up to?\n\nThat sounds great. I’ve been trying to stay active as well, but it can be tough sometimes. How do you motivate yourself to exercise when you don’t feel like it?\n\nI find that setting goals and finding activities that I enjoy help me stay motivated. For example, I might set a goal to walk a certain number of steps each day, or I might try a new workout routine that I find interesting. It’s also helpful to remember how good I feel after exercising, even if it’s just a short walk.\n\nThat’s a good strategy. I’ll have to try that. Speaking of goals, do you have any big plans or aspirations for the future?\n\nI do have some goals that I’m working towards, but I try not to get too caught up in them. I believe that it']

Added Mistral-7B-Instruct-v0.3 as mistral model. Also added mistral engine to support the model.
Added mistral model to examples folder. Also updated README.md to include mistral model.
Updated the transformers version to 4.40.0 to fix the issue with loading the mistral model.
Also added scipy to the dependencies list.
@jashdalvi jashdalvi changed the title Jash/mistral Add Support for Mistral-7B model Sep 21, 2024
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

Successfully merging this pull request may close these issues.

1 participant