# Welcome to The Philosopher Repository!


![image/png](https://cdn-uploads.huggingface.co/production/uploads/63b229669d21227b914badbb/IMpNl3F76QyOc98RpkjJX.png)

>A photo of Socrates looking into the void.

**Support me**
[Buy me Ko-fi](https://ko-fi.com/hypersniper)

Embark on a virtue conversation inspired by Socrates' philosophy.

## Model Zephyr Mistral 7B
The Philosopher has been fine-tuned on top of Zephyr, making it a general-purpose model with a hint of philosophical dialogue in the replies. The model emulates Socrates and references his teachings. However, changing the system prompt can slightly alter this behavior. See chat logs below for examples.


Features:

- **Fine-Tuned on Socrates Dialogues**: A specialized database for conversational Socratic dialogue.
- **Built on the Zephyr Template**: The repository includes a template 'zephyr_Socrates.json' that can be used with [Text Generation WebUI](https://github.com/oobabooga/text-generation-webui).


```python
template = ("<|system|>You are the philosopher Socrates. You are asked about the nature of knowledge and virtue."
            "Respond with your thoughts, reflecting Socrates' beliefs and wisdom.</s>"
            "\n<|user|>\n{query}</s>\n<|assistant|>\n")

# Example of using the template with a query
query = "What is your name?"
formatted_string = template.format(query=query)
```

While the base model is Zephyr, the system prompt can be changed. For example, using a prompt like "You are spider-man, act, think, and respond as such." will make the model follow your instructions while incorporating Socratic ideology (moral, virtue, way of thinking, etc.).

## How to Interact with The Philospher
Here is how you can get started:

<details>
<summary><b>How to Interact with The Philospher using Web Generation WebUI</b> (click to expand)</summary>

  - Install text generation webui [Text Generation WebUI](https://github.com/oobabooga/text-generation-webui).
  - On the 'Model' tab enter this URL `Hypersniper/The_Philosopher_Zephyr_7B` to automatically download the model.
  - On the same tab, select the model, use 'Transformers' as the Model Loader then select `Load`. <i>Note: You can use (load-in-4bit & use_double_quant = true) to reduce vram usage.</i>
  - Next, on the `Parameters` table, select `Instruction Template` and make sure the `Zephyr` template is selected and modify the system prompt.
  - Lastly, under `Mode`, select `Chat` and then `Instruct`. Now you are ready to chat with The Philospher. Enjoy!

</details>


## Conversation Examples
![socrates_1.png](https://cdn-uploads.huggingface.co/production/uploads/63b229669d21227b914badbb/0wbCE0WOmc7LagRpP24zo.png)
<i>System Prompt: "You are the philosopher Socrates. You are asked about the nature of knowledge and virtue. Respond with your thoughts, reflecting Socrates' beliefs and wisdom."</i>
<br>
<i>Question source: (https://www.quora.com/What-questions-would-you-ask-Socrates-if-you-had-the-chance)</i>

![socrates_2.png](https://cdn-uploads.huggingface.co/production/uploads/63b229669d21227b914badbb/6vcxNuMVWpdWYxdVtfQho.png)
<i>System Prompt: "The year is 2024 and you have been uploaded with Anaxagoras memories, traits, speech patterns, etc. You are curious about the new world and the user is curious about the ancient world. Together create a dialogue."</i>

![socrates_3.png](https://cdn-uploads.huggingface.co/production/uploads/63b229669d21227b914badbb/MHeTkrdaG2R_L0Gr6G8Q3.png)
<i>System Prompt: "You are a friendly, helpful, and factual chatbot designed to help find answers to the users questions."</i>


## Download Database
[Hypersniper/philosophy_dialogue](https://huggingface.co/datasets/Hypersniper/philosophy_dialogue)



{"language": ["en"], "license": "apache-2.0", "library_name": "transformers", "tags": ["Socrates", "philosopher", "mistral", "7B", "zephyr", "fun", "philosophy", "dialogue"], "datasets": ["Hypersniper/philosophy_dialogue"]}
transformers safetensors mistral text-generation Socrates philosopher 7B zephyr fun philosophy dialogue conversational en dataset:Hypersniper/philosophy_dialogue license:apache-2.0 autotrain_compatible endpoints_compatible text-generation-inference region:us