File size: 1,908 Bytes
a20f003
 
 
 
 
 
 
 
 
 
 
 
 
3696221
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a20f003
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
title: Bolt Torque Calculator
emoji: 📉
colorFrom: purple
colorTo: indigo
sdk: gradio
sdk_version: 5.47.2
app_file: app.py
pinned: false
license: mit
short_description: First-principles calculation of bolt torque
---

# Bolt Torque Calculator  

**Author:** Sebastian Andreu  
**Course:** 24679 - Designing and Deploying AI/ML Systems  

This app calculates the torque required to tighten a bolt to a target preload using first-principles engineering formulas.  
The interface allows users to input or select:  
- Bolt diameter [mm]  
- Target preload [N]  
- Thread pitch [mm]  
- Bolt material and lubrication (for estimating thread friction coefficient)  
- Nut/under-head material and lubrication (for estimating friction under the head)  
- Optional head diameter [mm]  

The model outputs the required torque in **Nm** along with a natural language explanation of the result for non-experts.  

---

## How to Use  
1. Enter the bolt geometry and preload values.  
2. Select the bolt and nut/head materials and lubrication type.  
3. Optionally specify the head diameter; leave blank to use default (1.5×bolt diameter).  
4. Click **Compute** to see the torque and an easy-to-understand explanation.  

---

## Deployment Details  
- **Frameworks:** [Gradio](https://gradio.app/)  
- **Hosting:** Hugging Face Spaces  
- **Model Loading:** The LLM used for explanations is downloaded from the Hugging Face Hub on startup.  

---

## Requirements  
Dependencies are listed in `requirements.txt`.  
Includes: `gradio`, `pandas`, `transformers`  

---

## Acknowledgments  
- Torque calculation formulas based on standard ISO metric bolt theory  
- Deployment scaffold and documentation supported with AI assistance (ChatGPT, OpenAI)  
- Reference: Class-provided notebook *beam_gradio.ipynb*  

---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference