This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def generate_with_cache(model, model_inputs, max_new_tokens): | |
| ''' Use past_key_values for a theoretical speedup. ''' | |
| generated_tokens = [] | |
| past_key_values = None | |
| next_token = None | |
| input_ids = model_inputs['input_ids'] | |
| attention_mask = model_inputs['attention_mask'] | |
| for i in range(max_new_tokens): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # If you want to develop for FreeCAD in an environment that is aware of all the baked-in imports, simply do this! | |
| FreeCAD...AppImage --appimage-extract # create squashfs-root/ dir | |
| # create venv using appimage's python | |
| squashfs-root/usr/bin/python -m venv .env | |
| # Add this to `.env/bin/activate` | |
| export FREECAD_ROOT=<SQUASHFS_LOCATION>/usr | |
| export PYTHONPATH=$FREECAD_ROOT/lib:$FREECAD_ROOT/lib/python3.11/site-packages:$FREECAD_ROOT/lib/python3.11:$FREECAD_ROOT/Mod:$PYTHONPATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Use the new CAM simulator with custom stock and custom cutting paths | |
| ''' | |
| import FreeCAD as App | |
| import FreeCADGui as Gui | |
| import Part | |
| import CAMSimulator | |
| from PathScripts import PathUtils | |
| import Path.Dressup.Utils as PathDressup |
OlderNewer