WhoIsTheHuman is an AI-powered game that challenges players to disguise themselves as AI characters while trying to figure out who among them is the real human. The game uses AI models for character roleplay and voting, voice recognition for player input, and text-to-speech (TTS) for character responses.
Players must maintain their character persona while interacting with AI-generated characters like Einstein, Genghis Khan, and Cleopatra. At the end of each round, all players (including AI) vote on who they think is the human, and the player suspected the most loses.
For acceptable performance this app requires a Nvidia GPU to run the LLM and the app. CPU works but is much much slower.
- Voice Recognition: Players use voice commands to participate in the game.
- AI Roleplay: The game master and other characters are simulated by AI.
- Text-to-Speech: Responses are spoken aloud using TTS models.
- Two-Round System:
- In Round 1, players introduce themselves and maintain their character roles.
- In Round 2, players vote on who they think is the human.
- Character Assignment: The player is randomly assigned a historical character like Einstein, Genghis Khan, or Cleopatra.
- Round 1 (Introduction): Players introduce themselves in character, and AI-generated characters also respond in their specific personas.
- Round 2 (Voting): Players and AI vote on who they suspect is the human. AI votes based on reasoning provided by the language models.
- Results: The game master counts the votes, and the player with the most votes loses (if they were suspected of being human).
- Run Server on LM Studuio:
The game uses a local Large Language Model (LLM). Ensure you have the model running locally at
localhost:1234
. You can adjust this in the code by modifying theclient
initialization. The code here uses the Server function provided in LM Studio.
To set up and run the game locally, follow these steps:
-
Download the WhoIsTheHuman.py file
-
Open the directory the game is downloaded to and type cmd in the directory field to open the comandline in this folder.
-
Install the required software:**
pip install openai-whisper pyaudio webrtcvad pydub fuzzywuzzy torch openai tts
-
Run the Game:
Start the game with the following command:
python WhoIsTheHuman.py
- Launch the game and wait for the Ai's to introduce themself.
- Follow on-screen instructions to introduce yourself in character.
- Interact via voice: Your microphone will be used to detect your responses.
- Vote on the human in the second round.
- The game will announce the results via TTS, and the human player will be revealed.
- Whisper: For speech-to-text transcription.
- WebRTC VAD: For detecting voice activity in real-time.
- PyAudio: For capturing audio from the microphone.
- FuzzyWuzzy: For approximate string matching (used to find and match the role you voted for since speach recognition not always translates the name correctly).
- Text-to-Speech: The game uses the
TTS
library for different character voices. - OpenAI: Used for generating responses from the game master and AI characters.
-
For local LLM issues, ensure that the server is up and running at the correct URL.
-
If the app runs slow and the output of the logging line is
Is CUDA available? False
then it seems you are running on cpu only mode. When you have a GPU and it is still slow it might be that you are missing some important NVIDIA installs. Try the following commands to do a fresh install:
pip uninstall torch torchvision torchaudio pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
Now you should see the following output:
Is CUDA available? True Using device: cuda:0
If that doesnt work you likely havent CUDA toolkit installed. You find it here: https://developer.nvidia.com/cuda-downloads
Feel free to fork this repository and submit pull requests if you'd like to contribute to improving the game. Issues and feature requests are welcome as well.
This project is licensed under the MIT License - see the LICENSE file for details.