Downloads · 30 days
18
15% of all-time downloads
Berthi-Rohar/ScholasticLogicAI-Phi-4
ScholasticLogicAI-Phi-4 is a text generation model from Berthi-Rohar. Use it when you need the model to write or continue text. It is set up for transformers.
This is a fine-tuned version of microsoft/phi-4 specialized in logical analysis within the paradigm of Aristotelian/scholastic logic. It's like the last one with Gemma, but better, I think.
Downloads · 30 days
18
15% of all-time downloads
All-time downloads
123
Public
Parameters
14.7B
29.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors29.3 GB · 100%
From the Hugging Face model README
This is a fine-tuned version of microsoft/phi-4 specialized in logical analysis within the paradigm of Aristotelian/scholastic logic. It's like the last one with Gemma, but better, I think.
These models represent a proof-of-concept for a personal project, and as such are in their very early stages. I expect these models to fail and hallucinate more often than not. But anyway I think I cooked with this one.
How to use
This model expects input formatted with the Phi-4 chat template (though I still need to clean this up). On Google Colab, use the following script:
# --- STATELESS CHATBOT ---
# Each query is treated as a fresh, independent task.
import transformers
import torch
# 1. Load the pipeline
hub_model_id = "Berthi-Rohar/ScholasticLogicAI-Gemma3-12B-PT"
print(f"Loading model: {hub_model_id}")
pipe = transformers.pipeline(
"text-generation",
model=hub_model_id,
model_kwargs={"torch_dtype": torch.bfloat16, "device_map": "auto"},
)
tokenizer = pipe.tokenizer
print("✅ Model loaded successfully")
# 2. The Stateless Chat Loop
def run_stateless_chat():
print("\n" + "="*50)
print("🤖 Machinula Syllogistica (STATELESS MODE)")
print(" (Each query is a fresh start. No memory.)")
print("="*50)
while True:
user_input = input("\nYou: ")
if user_input.lower() in ["quit", "exit"]:
print("🤖 Goodbye!")
break
conversation_history = [{"role": "user", "content": user_input}]
# This part remains the same
prompt = tokenizer.apply_chat_template(conversation_history, tokenize=False, add_generation_prompt=True)
outputs = pipe(
prompt,
max_new_tokens=1024,
do_sample=False,
# NEW: This is the key change to stop the prompt from being repeated
return_full_text=False,
eos_token_id=tokenizer.eos_token_id,
)
# CHANGED: The post-processing is now much simpler
model_response = outputs[0]['generated_text'].replace("<|end|>", "").strip()
print(f"\n🤖 Machinula Syllogistica:\n{model_response}")
# 3. Start the chat
run_stateless_chat()
Shout outs to Google Gemini, you one of the ones.