daviddwlee84 commited on
Commit
91cbdf3
·
1 Parent(s): 985d047

Try downgrade version for legacy SavedModel format

Browse files
.specstory/.what-is-this.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # SpecStory Artifacts Directory
3
+
4
+ This directory is automatically created and maintained by the SpecStory extension to preserve your Cursor composer and chat history.
5
+
6
+ ## What's Here?
7
+
8
+ - `.specstory/history`: Contains markdown files of your AI coding sessions
9
+ - Each file represents a separate chat or composer session
10
+ - Files are automatically updated as you work
11
+ - `.specstory/cursor_rules_backups`: Contains backups of the `.cursor/rules/derived-cursor-rules.mdc` file
12
+ - Backups are automatically created each time the `.cursor/rules/derived-cursor-rules.mdc` file is updated
13
+ - You can enable/disable the Cursor Rules feature in the SpecStory settings, it is disabled by default
14
+
15
+ ## Valuable Uses
16
+
17
+ - Capture: Keep your context window up-to-date when starting new Chat/Composer sessions via @ references
18
+ - Search: For previous prompts and code snippets
19
+ - Learn: Meta-analyze your patterns and learn from your past experiences
20
+ - Derive: Keep Cursor on course with your past decisions by automatically deriving Cursor rules from your AI interactions
21
+
22
+ ## Version Control
23
+
24
+ We recommend keeping this directory under version control to maintain a history of your AI interactions. However, if you prefer not to version these files, you can exclude them by adding this to your `.gitignore`:
25
+
26
+ ```
27
+ .specstory
28
+ ```
29
+
30
+ We recommend not keeping the `.specstory/cursor_rules_backups` directory under version control if you are already using git to version the `.cursor/rules` directory, and committing regularly. You can exclude it by adding this to your `.gitignore`:
31
+
32
+ ```
33
+ .specstory/cursor_rules_backups
34
+ ```
35
+
36
+ ## Searching Your Codebase
37
+
38
+ When searching your codebase in Cursor, search results may include your previous AI coding interactions. To focus solely on your actual code files, you can exclude the AI interaction history from search results.
39
+
40
+ To exclude AI interaction history:
41
+
42
+ 1. Open the "Find in Files" search in Cursor (Cmd/Ctrl + Shift + F)
43
+ 2. Navigate to the "files to exclude" section
44
+ 3. Add the following pattern:
45
+
46
+ ```
47
+ .specstory/*
48
+ ```
49
+
50
+ This will ensure your searches only return results from your working codebase files.
51
+
52
+ ## Notes
53
+
54
+ - Auto-save only works when Cursor/sqlite flushes data to disk. This results in a small delay after the AI response is complete before SpecStory can save the history.
55
+ - Auto-save does not yet work on remote WSL workspaces.
56
+
57
+ ## Settings
58
+
59
+ You can control auto-saving behavior in Cursor:
60
+
61
+ 1. Open Cursor → Settings → VS Code Settings (Cmd/Ctrl + ,)
62
+ 2. Search for "SpecStory"
63
+ 3. Find "Auto Save" setting to enable/disable
64
+
65
+ Auto-save occurs when changes are detected in Cursor's sqlite database, or every 2 minutes as a safety net.
.specstory/history/2025-03-27_10-23-downgrading-keras-for-model-compatibility.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- Generated by SpecStory -->
2
+
3
+ # Downgrading Keras for Model Compatibility (2025-03-27 18:23:30)
4
+
5
+ _**User**_
6
+
7
+ ```
8
+ Traceback (most recent call last):
9
+ File "/home/user/app/app.py", line 10, in <module>
10
+ model = from_pretrained_keras("keras-io/GauGAN-Image-generation")
11
+ File "/usr/local/lib/python3.10/site-packages/huggingface_hub/keras_mixin.py", line 293, in from_pretrained_keras
12
+ return KerasModelHubMixin.from_pretrained(*args, **kwargs)
13
+ File "/usr/local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
14
+ return fn(*args, **kwargs)
15
+ File "/usr/local/lib/python3.10/site-packages/huggingface_hub/hub_mixin.py", line 553, in from_pretrained
16
+ instance = cls._from_pretrained(
17
+ File "/usr/local/lib/python3.10/site-packages/huggingface_hub/keras_mixin.py", line 495, in _from_pretrained
18
+ model = keras.models.load_model(storage_folder)
19
+ File "/usr/local/lib/python3.10/site-packages/keras/src/saving/saving_api.py", line 206, in load_model
20
+ raise ValueError(
21
+ ValueError: File format not supported: filepath=/home/user/.cache/huggingface/hub/models--keras-io--GauGAN-Image-generation/snapshots/7a1e67f1092af97d0810313eaf75836a20d9b6f6. Keras 3 only supports V3 `.keras` files and legacy H5 format files (`.h5` extension). Note that the legacy SavedModel format is not supported by `load_model()` in Keras 3. In order to reload a TensorFlow SavedModel as an inference-only layer in Keras 3, use `keras.layers.TFSMLayer(/home/user/.cache/huggingface/hub/models--keras-io--GauGAN-Image-generation/snapshots/7a1e67f1092af97d0810313eaf75836a20d9b6f6, call_endpoint='serving_default')` (note that your `call_endpoint` might have a different name).
22
+ ```
23
+
24
+ Please help me downgrade (specify correct dependency version at @requirements.txt) so we can run old model
25
+
26
+ ---
27
+
28
+ _**Assistant**_
29
+
30
+
31
+
32
+ ---
33
+
34
+ I'll edit the requirements.txt file to specify an earlier version of TensorFlow that's compatible with the model format you're trying to load. The error shows you're using Keras 3, but the model is in a format only supported by Keras 2.x.
35
+
36
+ ---
37
+
38
+ ```diff
39
+ - tensorflow
40
+ + tensorflow==2.12.0
41
+ numpy
42
+ matplotlib
43
+ ```
44
+
45
+ ---
46
+
47
+ Now you should reinstall the dependencies with:
48
+
49
+ ```bash
50
+ pip install -r requirements.txt
51
+ ```
52
+
53
+ This will install TensorFlow 2.12.0 which uses Keras 2.x, which supports loading the SavedModel format your GauGAN model is using.
54
+
55
+ ---
56
+
57
+
58
+
59
+ ---
60
+
requirements.txt CHANGED
@@ -1,4 +1,5 @@
1
- tensorflow
 
2
  numpy
3
  matplotlib
4
  Pillow
 
1
+ tensorflow==2.12.0
2
+ keras==2.15.0 # For compatibility with SavedModel format
3
  numpy
4
  matplotlib
5
  Pillow