Downloads · 30 days
0
superdrew100/mistral_7b_quotation_attribution
mistral_7b_quotation_attribution is a machine learning model from superdrew100. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Downloads · 30 days
0
Access
Public
Updated Apr 11, 2024
Repo size
—
Likes
0
Public
Click a slice to open those files.
.csv4.2 MB · 100%
From the Hugging Face model README
how to use model with gpt4all
import pandas as pd from datasets import load_dataset import re csv_file = "/Users/admin/Downloads/GPT4_output_GPT-2_training_df.csv"
dataset = load_dataset("csv", data_files=csv_file, split="train")
def stop_on_token_callback(token_id, token_string): # one sentence is enough: if '<eos>' in token_string: return False else: return True
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
Find out which character said this specific quote along with their gender
{}
{}""" num_examples=10 from gpt4all import GPT4All model = GPT4All('/Users/admin/Downloads/model-unsloth.Q4_K_M.gguf') system_template = '''Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.'''
prompt_template = """### Instruction: Find out which character said this specific quote along with their gender
{0}
""" with model.chat_session(system_template, prompt_template): for i in range(min(num_examples, len(dataset))): row = dataset[i] #response1 = model.generate(row['formatted_input'], callback=stop_on_token_callback) print(i) response1 = model.generate(row['formatted_input']) print(response1) print() print(f"Correct output: {row['TrueSpeaker']}")