Skip to content

Commit

Permalink
Merge pull request #18 from MirageML/aman/fix_config
Browse files Browse the repository at this point in the history
Fix config
  • Loading branch information
AmanKishore authored Oct 23, 2023
2 parents 8779fde + e2736a3 commit 9554000
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,20 @@ mirage chat [OPTIONS]
╰───────────────────────────────────────────────────────────────────────────────────────────╯
```

## Contributing
If you want to contribute to MirageML, follow these steps:

1. Fork the repository: Click on the 'Fork' button at the top right corner of the repository page on GitHub.
2. Clone the forked repository to your local machine. `git clone https://github.com/<user_name>/mirageml_pip.git`
3. Create a new branch for your changes: `git checkout -b <user_name>/your-branch-name`
4. Review the [CONTRIBUTING.md](CONTRIBUTING.md) file for details on installing pip pacakages, testing, and linting.
4. Make your changes in this branch.
5. Commit your changes: `git commit -m "Your commit message"`
6. Push your changes to your forked repository: `git push origin your-branch-name`
7. Create a Pull Request: Go to your forked repository on GitHub and click on 'New Pull Request'.

Please provide a clear and concise description of your changes in the pull request description.


## Support
Send an email to [support@mirageml.com](mailto:support@mirageml.com) for support.
4 changes: 3 additions & 1 deletion mirageml/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ def set_config():
config = load_config()

valid = {
"local_mode": (("True", "False"), json.loads),
"local_mode": (("True (not recommended without GPU)", "False"), json.loads),
"model": (("gpt-3.5-turbo", "gpt-4"), str),
}

for key, value in config.items():
if key not in valid:
continue
curvalue = value
while True:
question = f"Enter the value for '{key}' [{', '.join(valid[key][0])}] (current value: {curvalue}): "
Expand Down
4 changes: 4 additions & 0 deletions mirageml/commands/utils/brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
def local_get_embedding(text_list, embedding_model_id="BAAI/bge-small-en-v1.5"):
from sentence_transformers import SentenceTransformer

os.environ["TOKENIZERS_PARALLELISM"] = "false"

model_dir = os.path.join(PACKAGE_DIR, "models", embedding_model_id)
if not os.path.exists(model_dir):
os.makedirs(model_dir, exist_ok=True)
Expand All @@ -41,6 +43,8 @@ def local_get_embedding(text_list, embedding_model_id="BAAI/bge-small-en-v1.5"):
def local_llm_call(messages, llm_model_id="TheBloke/Llama-2-7b-Chat-GGUF", stream=False):
from ctransformers import AutoModelForCausalLM

os.environ["TOKENIZERS_PARALLELISM"] = "false"

model_dir = os.path.join(PACKAGE_DIR, "models", llm_model_id)
if not os.path.exists(model_dir):
os.makedirs(model_dir, exist_ok=True)
Expand Down
2 changes: 1 addition & 1 deletion mirageml_version/_version_generated.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright Mirage ML 2023
build_number = 8
build_number = 10

0 comments on commit 9554000

Please sign in to comment.