codys12 commited on
Commit
ff9ed03
·
1 Parent(s): e24c49a

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +56 -13
README.md CHANGED
@@ -1,13 +1,56 @@
1
- ---
2
- title: Mistral 7b Pathway 128k 3
3
- emoji: 🏃
4
- colorFrom: purple
5
- colorTo: gray
6
- sdk: gradio
7
- sdk_version: 4.4.1
8
- app_file: app.py
9
- pinned: false
10
- license: apache-2.0
11
- ---
12
-
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Pseudo-Deterministic Chatbot with Mistral 7B
2
+
3
+ ## Overview
4
+ This repository contains a fine-tuned version of the Mistral 7B model, specifically designed for creating pseudo-deterministic chatbots. The goal of this project is to enhance the predictability and consistency of chatbot responses while maintaining the flexibility and adaptability of the Mistral 7B model.
5
+
6
+ ## Features
7
+ - **Fine-tuned Mistral 7B Model**: Leveraging the power of the Mistral 7B, our model is fine-tuned to offer more deterministic responses, ensuring consistency in conversational contexts.
8
+ - **Scalable Hugging Face Endpoint**: We provide a handler script for deploying the chatbot model on a scalable endpoint using Hugging Face's infrastructure. This setup is ideal for handling varying loads with efficient resource management. This can be deployed for public, protected, or private use with ASW privatelink. This handler script can also be used to serve the model on custom hardware.
9
+ - **Gradio Interface**: A Gradio demo is included, offering a user-friendly interface to interact with the chatbot. This demo can connect not only to our provided backend but also to any alternative backend setup.
10
+
11
+ ## Getting Started
12
+
13
+ 1. **Deploying the Model**:
14
+ You can deploy from the model repo ([here](https://huggingface.co/codys12/Mistral-7b-Pathway-128k-3/tree/main)) by clicking "Deploy" in the upper right corner.
15
+ or with [Inference Endpoints SDK](https://huggingface.co/docs/inference-endpoints/index)
16
+
17
+ 3. **Running the Gradio Demo**:
18
+ You can deploy directly from hugginface or
19
+ *with Python:*
20
+ ```python
21
+ import gradio as gr
22
+
23
+ gr.load("models/codys12/Mistral-7b-Pathway-128k-3").launch()
24
+ ```
25
+ You can embed the space with the URL found in the upper right of the space with "Share"
26
+ ```javascript
27
+ <iframe
28
+ src="https://your.hf.space"
29
+ frameborder="0"
30
+ width="850"
31
+ height="450"
32
+ ></iframe>
33
+ ```
34
+
35
+ ## Usage
36
+ - **Model Interaction**:
37
+ ```python
38
+ def generate(
39
+ message: str,
40
+ chat_history: list[tuple[str, str]],#Conversation history
41
+ system_prompt: str = "",
42
+ instruction: str = None,#The goal of the current conversation
43
+ conclusions: list[tuple[str, str]] = None,#AI classification of conversation ending
44
+ #^ Formatted: [["CONCLUSION_KEY","Conclusion criteria"]]
45
+ context: list[str] = None,#List of strings to be used as context. Indexes that were used will be returned.
46
+ max_new_tokens: int = 1024,#Max new tokens to generate
47
+ temperature: float = 0.6,#Temperature hyperparameter
48
+ top_p: float = 0.9,#Top-p hyperparameter
49
+ top_k: int = 50, #Top-k hyperparameter
50
+ repetition_penalty: float = 1.2, #Repitition hyperparameter
51
+ end_sequences: list[str] = ["[INST]", "[/INST]", "\n"]#Sequences that break the generation and return
52
+ ```
53
+ - **Customization**: conversation topics and their possible ansers/paths are stored in topics.json. You can freely change this to fit a desired use case.
54
+
55
+ ## License
56
+ This project is licensed under the Apache License, Version 2.0 - see the `LICENSE` file for details.