Update README.md
Browse files
README.md
CHANGED
|
@@ -1,16 +1,85 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
-
|
| 11 |
-
hf_oauth_scopes:
|
| 12 |
-
- inference-api
|
| 13 |
-
license: apache-2.0
|
| 14 |
---
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: ReAct - Reasoning Modes Comparison
|
| 3 |
+
emoji: ๐ง
|
| 4 |
+
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 6.0.2
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
license: mit
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# ๐ง LLM Reasoning Modes Comparison
|
| 14 |
+
|
| 15 |
+
This Space demonstrates and compares three different reasoning paradigms for Large Language Models using **openai/gpt-oss-20b**:
|
| 16 |
+
|
| 17 |
+
## ๐ฏ Reasoning Modes
|
| 18 |
+
|
| 19 |
+
### 1. **Think-Only** (Chain-of-Thought)
|
| 20 |
+
- Uses internal reasoning and knowledge only
|
| 21 |
+
- Shows step-by-step thought process
|
| 22 |
+
- No external tool access
|
| 23 |
+
- Best for: Problems solvable with general knowledge
|
| 24 |
+
|
| 25 |
+
### 2. **Act-Only** (Tool Use)
|
| 26 |
+
- Uses external tools to gather information
|
| 27 |
+
- Shows actions and observations only
|
| 28 |
+
- Minimal explicit reasoning
|
| 29 |
+
- Best for: Fact-checking and real-time data retrieval
|
| 30 |
+
|
| 31 |
+
### 3. **ReAct** (Reasoning + Acting)
|
| 32 |
+
- Interleaves Thought โ Action โ Observation
|
| 33 |
+
- Combines reasoning with tool use
|
| 34 |
+
- Most comprehensive approach
|
| 35 |
+
- Best for: Complex problems requiring both reasoning and external data
|
| 36 |
+
|
| 37 |
+
## ๐ ๏ธ Available Tools
|
| 38 |
+
|
| 39 |
+
The agent has access to these real external tools:
|
| 40 |
+
|
| 41 |
+
- **๐ DuckDuckGo Search**: Web search for current information
|
| 42 |
+
- **๐ Wikipedia Search**: Detailed encyclopedic knowledge
|
| 43 |
+
- **๐ค๏ธ Weather API**: Real-time weather data for any location
|
| 44 |
+
- **๐งฎ Calculator**: Safe mathematical expression evaluation
|
| 45 |
+
- **๐ Python REPL**: Execute Python code for data processing
|
| 46 |
+
|
| 47 |
+
## ๐ How to Use
|
| 48 |
+
|
| 49 |
+
1. Enter your question in the text box
|
| 50 |
+
2. Select a reasoning mode (or "All" to compare)
|
| 51 |
+
3. Click "Run" to see the agent work in real-time
|
| 52 |
+
4. Watch as thoughts, actions, and observations unfold
|
| 53 |
+
|
| 54 |
+
## ๐ Example Questions
|
| 55 |
+
|
| 56 |
+
- "What is the capital of France and what's the current weather there?"
|
| 57 |
+
- "Who wrote 'To Kill a Mockingbird' and when was it published?"
|
| 58 |
+
- "Calculate the compound interest on $1000 at 5% annual rate for 3 years"
|
| 59 |
+
- "What is the population of Tokyo and how does it compare to New York City?"
|
| 60 |
+
|
| 61 |
+
## ๐ง Setup
|
| 62 |
+
|
| 63 |
+
To run this Space, you need to set your Hugging Face token:
|
| 64 |
+
|
| 65 |
+
1. Go to Space Settings โ Repository Secrets
|
| 66 |
+
2. Add a secret named `HF_TOKEN` with your Hugging Face API token
|
| 67 |
+
3. The Space will automatically use this token to access the model
|
| 68 |
+
|
| 69 |
+
## ๐ Technical Details
|
| 70 |
+
|
| 71 |
+
- **Model**: openai/gpt-oss-20b (via Hugging Face Inference API)
|
| 72 |
+
- **Framework**: Gradio for the UI
|
| 73 |
+
- **Agent Format**: Inspired by smolagents/ReAct paradigm
|
| 74 |
+
- **Streaming**: Real-time display of intermediate steps
|
| 75 |
+
|
| 76 |
+
## ๐ Learn More
|
| 77 |
+
|
| 78 |
+
This implementation demonstrates the ReAct (Reason + Act) paradigm described in:
|
| 79 |
+
- Yao et al. (2022) "ReAct: Synergizing Reasoning and Acting in Language Models"
|
| 80 |
+
|
| 81 |
+
The three modes show how different combinations of reasoning and tool use affect problem-solving capabilities.
|
| 82 |
+
|
| 83 |
+
## ๐ License
|
| 84 |
+
|
| 85 |
+
MIT License - feel free to use and modify!
|