This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openai | |
from colorama import Fore | |
openai.api_base = "https://openrouter.ai/api/v1" | |
openai.api_key = "" #use own openrouter api key | |
system = "Your name is Bob. You are an intelligent and useful assistant that helps the user solve problems." | |
messages = [{"role" : "system", "content" : system},] | |
models = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ctransformers import AutoModelForCausalLM | |
from transformers import AutoTokenizer | |
from colorama import Fore | |
import torch | |
from io import StringIO | |
from contextlib import redirect_stdout | |
import os, sys, traceback | |
sys.path.append(os.getcwd()) | |
tokenizer = AutoTokenizer.from_pretrained("teknium/OpenHermes-2.5-Mistral-7B") |