make LoraBlend.cs change the values in the config file itself and save over then add a…
- User
make LoraBlend.cs change the values in the config file itself and save over then add a save button and stuff tysm!
'File To Edit: r_8_alpha_16.yaml | File Location: "C:\AI\fish-speech\fish_speech\configs\lora\r_8_alpha_16.yaml"' target: fish_speech.models.text2semantic.lora.LoraConfig r: 8 lora_alpha: 16 lora_dropout: 0.01
'LoraBlend.cs' using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Windows.Forms;
namespace ByteBreath { public partial class LoraBlend : Form { private const int graphPadding = 50; private readonly Rectangle graphRect;
// Parameters as editable curves with control points [X from 0 to 1, Y from 0 to 1] private readonly EditableCurve rCurve = new EditableCurve("r", Color.FromArgb(0, 120, 215)); private readonly EditableCurve alphaCurve = new EditableCurve("lora_alpha", Color.FromArgb(32, 178, 170)); private readonly EditableCurve dropoutCurve = new EditableCurve("lora_dropout", Color.FromArgb(255, 140, 0), isNormalizedY: true); private EditableCurve activeCurve = null; private EditableCurve.CurvePoint grabbedPoint = null; // Label for hovered/control points private string infoLabel = ""; public LoraBlend() { this.DoubleBuffered = true; this.ClientSize = new Size(640, 480); this.Text = "AI Parameter Curve Editor"; graphRect = new Rectangle(graphPadding, graphPadding, ClientSize.Width - graphPadding * 2, ClientSize.Height - graphPadding * 2); InitializeCurves(); this.Paint += LoraBlend_Paint; this.MouseDown += LoraBlend_MouseDown; this.MouseMove += LoraBlend_MouseMove; this.MouseUp += LoraBlend_MouseUp; this.MouseDoubleClick += LoraBlend_MouseDoubleClick; this.KeyDown += LoraBlend_KeyDown; } private void InitializeCurves() { // Add sample points for each curve (X:0-1, Y:0-1) rCurve.Points.Clear(); rCurve.Points.Add(new EditableCurve.CurvePoint(0f, 0.08f)); rCurve.Points.Add(new EditableCurve.CurvePoint(0.5f, 0.55f)); rCurve.Points.Add(new EditableCurve.CurvePoint(1f, 0.8f)); alphaCurve.Points.Clear(); alphaCurve.Points.Add(new EditableCurve.CurvePoint(0f, 0.10f)); alphaCurve.Points.Add(new EditableCurve.CurvePoint(0.7f, 0.85f)); alphaCurve.Points.Add(new EditableCurve.CurvePoint(1f, 0.85f)); dropoutCurve.Points.Clear(); dropoutCurve.Points.Add(new EditableCurve.CurvePoint(0f, 0.01f)); dropoutCurve.Points.Add(new EditableCurve.CurvePoint(0.5f, 0.20f)); dropoutCurve.Points.Add(new EditableCurve.CurvePoint(1f, 0.05f)); // Sort just in case rCurve.Points.Sort(); alphaCurve.Points.Sort(); dropoutCurve.Points.Sort(); } private void LoraBlend_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; g.Clear(Color.White); DrawGrid(g); DrawAxes(g); // Draw each curve rCurve.Render(g, graphRect); alphaCurve.Render(g, graphRect); dropoutCurve.Render(g, graphRect); // Draw info label at bottom center if (!string.IsNullOrEmpty(infoLabel)) { var size = g.MeasureString(infoLabel, Font); g.FillRectangle(Brushes.WhiteSmoke, (ClientSize.Width - size.Width) / 2 - 4, ClientSize.Height - 30, size.Width + 8, size.Height + 4); g.DrawString(infoLabel, Font, Brushes.Black, (ClientSize.Width - size.Width) / 2, ClientSize.Height - 28); } } private void DrawGrid(Graphics g) { int step = 50; using (var pen = new Pen(Color.LightGray)) { for (int x = graphPadding; x <= graphPadding + graphRect.Width; x += step) { g.DrawLine(pen, x, graphPadding, x, graphPadding + graphRect.Height); } for (int y = graphPadding; y <= graphPadding + graphRect.Height; y += step) { g.DrawLine(pen, graphPadding, y, graphPadding + graphRect.Width, y); } } } private void DrawAxes(Graphics g) { using (var pen = new Pen(Color.Black, 2)) { // X axis g.DrawLine(pen, graphPadding, graphPadding + graphRect.Height, graphPadding + graphRect.Width, graphPadding + graphRect.Height); // Y axis g.DrawLine(pen, graphPadding, graphPadding, graphPadding, graphPadding + graphRect.Height); // Labels using (var brush = new SolidBrush(Color.Black)) { g.DrawString("Input domain (0..1)", Font, brush, graphPadding + graphRect.Width / 2 - 50, graphPadding + graphRect.Height + 10); g.DrawString("Parameter Value", Font, brush, 5, graphPadding + graphRect.Height / 2 - 20); } } } private void LoraBlend_MouseDown(object sender, MouseEventArgs e) { Point pt = e.Location; var hitDetectionRadius = 8; grabbedPoint = null; // Try find any curve point near cursor var candidates = new List<(EditableCurve curve, EditableCurve.CurvePoint point)>(); foreach (var curve in new[] { rCurve, alphaCurve, dropoutCurve }) { var found = curve.HitTestPoint(graphRect, pt, hitDetectionRadius); if (found != null) candidates.Add((curve, found)); } if (candidates.Count > 0) { var closest = candidates.OrderBy(c => Distance(PointToGraph(c.point, graphRect), pt)).First(); activeCurve = closest.curve; grabbedPoint = closest.point; infoLabel = $"Grabbed '{activeCurve.Name}' point: X={closest.point.X:0.00}, Y={closest.point.Y:0.00}"; Invalidate(); return; } // If right click on curve, add new point if (e.Button == MouseButtons.Right) { // Check which curve is near at clicked X position double normX = GraphToNormalizedX(pt.X, graphRect); var closestCurve = FindClosestCurveToX(normX, pt); if (closestCurve != null) { double normY = GraphToNormalizedY(pt.Y, graphRect); normY = Math.Min(Math.Max(normY, 0), 1); // Insert new control point into curve sorted by X closestCurve.Points.Add(new EditableCurve.CurvePoint((float)normX, (float)normY)); closestCurve.Points.Sort(); activeCurve = closestCurve; infoLabel = $"Added point at X={normX:0.00}, Y={normY:0.00} to '{closestCurve.Name}' (Right-click)"; Invalidate(); } } } private void LoraBlend_MouseMove(object sender, MouseEventArgs e) { Point pt = e.Location; if (grabbedPoint != null && activeCurve != null && e.Button == MouseButtons.Left) { // Move grabbed point, clamp X and Y inside bounds and ensure sorting by X float nx = (float)GraphToNormalizedX(pt.X, graphRect); float ny = (float)GraphToNormalizedY(pt.Y, graphRect); // Clamp 0..1 nx = Math.Min(Math.Max(nx, 0f), 1f); ny = Math.Min(Math.Max(ny, 0f), 1f); // Limit nx so it stays in order relative to neighbors int idx = activeCurve.Points.IndexOf(grabbedPoint); if (idx > 0) nx = Math.Max(nx, activeCurve.Points[idx - 1].X + 0.01f); if (idx < activeCurve.Points.Count - 1) nx = Math.Min(nx, activeCurve.Points[idx + 1].X - 0.01f); grabbedPoint.X = nx; grabbedPoint.Y = ny; infoLabel = $"Dragging '{activeCurve.Name}' point: X={grabbedPoint.X:0.00}, Y={grabbedPoint.Y:0.00}"; Invalidate(); return; } // Hover info for points on mouse move (no dragging) infoLabel = ""; foreach (var curve in new[] { rCurve, alphaCurve, dropoutCurve }) { var hit = curve.HitTestPoint(graphRect, pt, 8); if (hit != null) { infoLabel = $"'{curve.Name}' Point: X={hit.X:0.00}, Y={hit.Y:0.00}"; break; } } Invalidate(); } private void LoraBlend_MouseUp(object sender, MouseEventArgs e) { if (grabbedPoint != null) { infoLabel = $"Released '{activeCurve.Name}' point: X={grabbedPoint.X:0.00}, Y={grabbedPoint.Y:0.00}"; } grabbedPoint = null; } private void LoraBlend_MouseDoubleClick(object sender, MouseEventArgs e) { // Double-click near a point removes it (but keep minimum 2 points) Point pt = e.Location; var hitDetectionRadius = 8; foreach (var curve in new[] { rCurve, alphaCurve, dropoutCurve }) { var hit = curve.HitTestPoint(graphRect, pt, hitDetectionRadius); if (hit != null) { if (curve.Points.Count > 2) { curve.Points.Remove(hit); activeCurve = curve; infoLabel = $"Removed point from '{curve.Name}' (Double-click)"; Invalidate(); return; } } } } private void LoraBlend_KeyDown(object sender, KeyEventArgs e) { // Press 'R' to reset all curves if (e.KeyCode == Keys.R) { InitializeCurves(); infoLabel = "Reset all curves to default."; Invalidate(); } } private double Distance(Point a, Point b) { int dx = a.X - b.X; int dy = a.Y - b.Y; return Math.Sqrt(dx * dx + dy * dy); } // Map normalized curve X to screen pixel X private int NormalizedToGraphX(float normX, Rectangle rect) => rect.Left + (int)(normX * rect.Width); // Map normalized curve Y [0..1] to screen pixel Y (inverted) private int NormalizedToGraphY(float normY, Rectangle rect) => rect.Bottom - (int)(normY * rect.Height); private Point PointToGraph(EditableCurve.CurvePoint pt, Rectangle rect) => new Point(NormalizedToGraphX(pt.X, rect), NormalizedToGraphY(pt.Y, rect)); private double GraphToNormalizedX(int graphX, Rectangle rect) => (graphX - rect.Left) / (double)rect.Width; private double GraphToNormalizedY(int graphY, Rectangle rect) => (rect.Bottom - graphY) / (double)rect.Height; private EditableCurve FindClosestCurveToX(double normX, Point cursor) { double thresholdGraphPx = 30; EditableCurve closest = null; double closestDist = double.MaxValue; foreach (var curve in new[] { rCurve, alphaCurve, dropoutCurve }) { var y = curve.EvaluateAt(normX); var ptScreen = new Point(NormalizedToGraphX((float)normX, graphRect), NormalizedToGraphY((float)y, graphRect)); var dist = Distance(ptScreen, cursor); if (dist < thresholdGraphPx && dist < closestDist) { closestDist = dist; closest = curve; } } return closest; } // // Support classes // public class EditableCurve { public class CurvePoint : IComparable<CurvePoint> { public float X; public float Y; public CurvePoint(float x, float y) { X = x; Y = y; } public int CompareTo(CurvePoint other) { return X.CompareTo(other.X); } } public string Name { get; } public Color CurveColor { get; } public bool IsNormalizedY { get; } // true means Y is in 0..1 range, else different semantic (like dropout 0..1 but we handle more gracefully) public List<CurvePoint> Points { get; } = new List<CurvePoint>(); public EditableCurve(string name, Color color, bool isNormalizedY = true) { Name = name; CurveColor = color; IsNormalizedY = isNormalizedY; } // Draw curve and points on given graph rectangle public void Render(Graphics g, Rectangle graphRect) { if (Points.Count < 2) return; // Draw polyline with smooth Catmull-Rom spline interpolation var smoothedPoints = GenerateSmoothPoints(); using (var pen = new Pen(CurveColor, 3)) { g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; // Draw curve line g.DrawLines(pen, smoothedPoints.Select(p => ToGraphPoint(p, graphRect)).ToArray()); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; } // Draw points foreach (var pt in Points) { var gpt = ToGraphPoint(pt, graphRect); // Fill with gradient using (var brush = new SolidBrush(CurveColor)) { g.FillEllipse(Brushes.White, gpt.X - 7, gpt.Y - 7, 14, 14); g.DrawEllipse(new Pen(CurveColor, 2), gpt.X - 7, gpt.Y - 7, 14, 14); } } // Draw name label near last point var lastPt = ToGraphPoint(Points[Points.Count - 1], graphRect); g.DrawString(Name, SystemFonts.DefaultFont, new SolidBrush(CurveColor), lastPt.X + 5, lastPt.Y - 12); } private Point ToGraphPoint(CurvePoint pt, Rectangle rect) { int x = rect.Left + (int)(pt.X * rect.Width); int y = rect.Bottom - (int)(pt.Y * rect.Height); return new Point(x, y); } // Return a list of densely sampled points approximating a smooth curve (Catmull-Rom) private List<CurvePoint> GenerateSmoothPoints() { // Clamp points count >= 2 var pts = Points; if (pts.Count < 2) return new List<CurvePoint>(pts); var result = new List<CurvePoint>(); const int samplesPerSegment = 20; for (int i = 0; i < pts.Count - 1; i++) { CurvePoint p0 = i > 0 ? pts[i - 1] : pts[i]; CurvePoint p1 = pts[i]; CurvePoint p2 = pts[i + 1]; CurvePoint p3 = i + 2 < pts.Count ? pts[i + 2] : pts[i + 1]; for (int s = 0; s < samplesPerSegment; s++) { float t = s / (float)samplesPerSegment; var p = CatmullRomInterpolate(p0, p1, p2, p3, t); result.Add(p); } } // include last point explicitly result.Add(pts[pts.Count - 1]); return result; } private CurvePoint CatmullRomInterpolate(CurvePoint p0, CurvePoint p1, CurvePoint p2, CurvePoint p3, float t) { float t2 = t * t; float t3 = t2 * t; // Catmull-Rom spline formula float x = 0.5f * ((2 * p1.X) + (-p0.X + p2.X) * t + (2 * p0.X - 5 * p1.X + 4 * p2.X - p3.X) * t2 + (-p0.X + 3 * p1.X - 3 * p2.X + p3.X) * t3); float y = 0.5f * ((2 * p1.Y) + (-p0.Y + p2.Y) * t + (2 * p0.Y - 5 * p1.Y + 4 * p2.Y - p3.Y) * t2 + (-p0.Y + 3 * p1.Y - 3 * p2.Y + p3.Y) * t3); return new CurvePoint(Clamp01(x), Clamp01(y)); } private float Clamp01(float v) { if (v < 0f) return 0f; if (v > 1f) return 1f; return v; } // Returns the curve value (Y) at normalized X input using linear interpolation between nearest points public double EvaluateAt(double normX) { if (Points.Count == 0) return 0.0; if (normX <= Points[0].X) return Points[0].Y; if (normX >= Points[Points.Count - 1].X) return Points[Points.Count - 1].Y; CurvePoint left = Points[0], right = Points[Points.Count - 1]; for (int i = 0; i < Points.Count - 1; i++) { if (Points[i].X <= normX && Points[i + 1].X >= normX) { left = Points[i]; right = Points[i + 1]; break; } } double t = (normX - left.X) / (right.X - left.X); return left.Y + t * (right.Y - left.Y); } // Test if (screen) point is within radius pixels of any control point on graph public CurvePoint HitTestPoint(Rectangle graphRect, Point screenPt, int radius) { foreach (var pt in Points) { int px = graphRect.Left + (int)(pt.X * graphRect.Width); int py = graphRect.Bottom - (int)(pt.Y * graphRect.Height); Rectangle hitRect = new Rectangle(px - radius, py - radius, radius * 2, radius * 2); if (hitRect.Contains(screenPt)) return pt; } return null; } } } - Assistant
- User
| 2025-05-05 10:41:59.726 | INFO =8.810811, lora_dropout=0.15135135) Traceback (most recent call last): main:merge:31 - Loaded lora model with config LoraConfig(r=2.054054, lora_al File "C:\AI\fish-speech\tools\llama\merge_lora.py", line 96, in merge() File "C:\Users\DjZaN\miniconda3\envs\fish-speech\lib\site-packages\click\core.py", line 1161, in call return self.main(*args, **kwargs) File "C:\Users\DjZaN\miniconda3\envs\fish-speech\lib\site-packages\click\core.py", line 1082, in main rv self.invoke(ctx) File "C:\Users\DjZaN\miniconda3\envs\fish-speech\lib\site-packages\click\core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Users\DjZaN\miniconda3\envs\fish-speech\lib\site-packages\click\core.py", line 788, in invoke return __callback(*args, **kwargs) File "C:\AI\fish-speech\tools\llama\merge_lora.py", line 33, in merge llama_model = BaseTransformer.from_pretrained( File "C:\AI\fish-speech\fish_speech\models\text2semantic\llama.py", line 400, in from_pretrained setup_lora (model, lora_config) File "C:\AI\fish-speech\fish_speech\models\text2semantic\lora.py", line 15, in setup_lora model.embeddings = lora. Embedding( File "C:\Users\DjZaN\miniconda3\envs\fish-speech\lib\site-packages\loralib\layers.py", line 48, in self.lora_A = nn.Parameter(self.weight.new_zeros((r, num_embeddings))) TypeError: new_zeros(): argument 'size' (position 1) must be tuple of ints, but found element of type float at pos
- Assistant
The error:
- User
fix code return entire code
- Assistant
- User
adjust this to not make generations end so suddenly
target: fish_speech.models.vqgan.modules.firefly.FireflyArchitecture spec_transform: target: fish_speech.utils.spectrogram.LogMelSpectrogram sample_rate: 44100 n_mels: 160 n_fft: 2048 hop_length: 512 win_length: 2048 backbone: target: fish_speech.models.vqgan.modules.firefly.ConvNeXtEncoder input_channels: 160 depths: [3, 3, 9, 3] dims: [128, 256, 384, 512] drop_path_rate: 0.2 kernel_size: 7 head: target: fish_speech.models.vqgan.modules.firefly.HiFiGANGenerator hop_length: 512 upsample_rates: [8, 8, 2, 2, 2] # aka. strides upsample_kernel_sizes: [16, 16, 4, 4, 4] resblock_kernel_sizes: [3, 7, 11] resblock_dilation_sizes: [[1, 3, 5], [1, 3, 5], [1, 3, 5]] num_mels: 512 upsample_initial_channel: 512 pre_conv_kernel_size: 13 post_conv_kernel_size: 13 quantizer: target: fish_speech.models.vqgan.modules.fsq.DownsampleFiniteScalarQuantize input_dim: 512 n_groups: 8 n_codebooks: 1 levels: [8, 5, 5, 5] downsample_factor: [2, 2]
- Assistant
- User
you broke it keep in mind its a yaml file or whatever
- Assistant
_target_: fish_speech.models.vqgan.modules.firefly.FireflyArchitecture spec_transform: _target_: fish_speech.utils.spectrogram.LogMelSpectrogram sample_rate: 44100 n_mels: 160 n_fft: 2048 hop_length: 384 # adjusted from 512 to a lower value for smoother transitions win_length: 2048 backbone: _target_: fish_speech.models.vqgan.modules.firefly.ConvNeXtEncoder input_channels: 160 depths: [3, 3, 9, 3] dims: [128, 256, 384, 512] drop_path_rate: 0.2 kernel_size: 7 head: _target_: fish_speech.models.vqgan.modules.firefly.HiFiGANGenerator hop_length: 384 # keep consistent with spec_transform upsample_rates: [8, 8, 4, 2, 2] # split the upsampling steps a bit more gradually upsample_kernel_sizes: [16, 16, 8, 4, 4] resblock_kernel_sizes: [3, 7, 11] resblock_dilation_sizes: [[1, 3, 5], [1, 3, 5], [1, 3, 5]] num_mels: 512 upsample_initial_channel: 512 pre_conv_kernel_size: 13 post_conv_kernel_size: 13 quantizer: _target_: fish_speech.models.vqgan.modules.fsq.DownsampleFiniteScalarQuantize input_dim: 512 n_groups: 8 n_codebooks: 1 levels: [8, 5, 5, 5] downsample_factor: [2, 2] - User
you keep breaking it, heres the original working one
target: fish_speech.models.vqgan.modules.firefly.FireflyArchitecture spec_transform: target: fish_speech.utils.spectrogram.LogMelSpectrogram sample_rate: 44100 n_mels: 160 n_fft: 2048 hop_length: 512 win_length: 2048 backbone: target: fish_speech.models.vqgan.modules.firefly.ConvNeXtEncoder input_channels: 160 depths: [3, 3, 9, 3] dims: [128, 256, 384, 512] drop_path_rate: 0.2 kernel_size: 7 head: target: fish_speech.models.vqgan.modules.firefly.HiFiGANGenerator hop_length: 512 upsample_rates: [8, 8, 2, 2, 2] # aka. strides upsample_kernel_sizes: [16, 16, 4, 4, 4] resblock_kernel_sizes: [3, 7, 11] resblock_dilation_sizes: [[1, 3, 5], [1, 3, 5], [1, 3, 5]] num_mels: 512 upsample_initial_channel: 512 pre_conv_kernel_size: 13 post_conv_kernel_size: 13 quantizer: target: fish_speech.models.vqgan.modules.fsq.DownsampleFiniteScalarQuantize input_dim: 512 n_groups: 8 n_codebooks: 1 levels: [8, 5, 5, 5] downsample_factor: [2, 2]
- Assistant
_target_: fish_speech.models.vqgan.modules.firefly.FireflyArchitecture spec_transform: _target_: fish_speech.utils.spectrogram.LogMelSpectrogram sample_rate: 44100 n_mels: 160 n_fft: 2048 hop_length: 512 win_length: 2048 backbone: _target_: fish_speech.models.vqgan.modules.firefly.ConvNeXtEncoder input_channels: 160 depths: [3, 3, 9, 3] dims: [128, 256, 384, 512] drop_path_rate: 0.2 kernel_size: 7 head: _target_: fish_speech.models.vqgan.modules.firefly.HiFiGANGenerator hop_length: 512 upsample_rates: [8, 8, 4, 2, 2] # increased middle upsample rate from 2 to 4 for smoother transitions upsample_kernel_sizes: [16, 16, 8, 4, 4] # expanded corresponding kernel sizes resblock_kernel_sizes: [3, 7, 11] resblock_dilation_sizes: [[1, 3, 5], [1, 3, 5], [1, 3, 5]] num_mels: 512 upsample_initial_channel: 512 pre_conv_kernel_size: 13 post_conv_kernel_size: 13 quantizer: _target_: fish_speech.models.vqgan.modules.fsq.DownsampleFiniteScalarQuantize input_dim: 512 n_groups: 8 n_codebooks: 1 levels: [8, 5, 5, 5] downsample_factor: [2, 2] - User
target: fish_speech.models.vqgan.modules.firefly.FireflyArchitecture spec_transform: target: fish_speech.utils.spectrogram.LogMelSpectrogram sample_rate: 44100 n_mels: 160 n_fft: 2048 hop_length: 512 win_length: 2048 backbone: target: fish_speech.models.vqgan.modules.firefly.ConvNeXtEncoder input_channels: 160 depths: [3, 3, 9, 3] dims: [128, 256, 384, 512] drop_path_rate: 0.2 kernel_size: 7 head: target: fish_speech.models.vqgan.modules.firefly.HiFiGANGenerator hop_length: 512 upsample_rates: [8, 8, 2, 2, 2] # aka. strides upsample_kernel_sizes: [16, 16, 4, 4, 4] resblock_kernel_sizes: [3, 7, 11] resblock_dilation_sizes: [[1, 3, 5], [1, 3, 5], [1, 3, 5]] num_mels: 512 upsample_initial_channel: 512 pre_conv_kernel_size: 13 post_conv_kernel_size: 13 quantizer: target: fish_speech.models.vqgan.modules.fsq.DownsampleFiniteScalarQuantize input_dim: 512 n_groups: 8 n_codebooks: 1 levels: [8, 5, 5, 5] downsample_factor: [2, 2]
cant change hop length without it throwing an error
- Assistant
Understood — since changing
hop_lengthcauses errors, let's keep that unchanged. The main way to reduce sudden endings without touchinghop_lengthis to smooth the upsampling stages a bit by adjusting theupsample_ratesand correspondingupsample_kernel_sizesonly.Here’s your original config with just one minimal change:
_target_: fish_speech.models.vqgan.modules.firefly.FireflyArchitecture spec_transform: _target_: fish_speech.utils.spectrogram.LogMelSpectrogram sample_rate: 44100 n_mels: 160 n_fft: 2048 hop_length: 512 win_length: 2048 backbone: _target_: fish_speech.models.vqgan.modules.firefly.ConvNeXtEncoder input_channels: 160 depths: [3, 3, 9, 3] dims: [128, 256, 384, 512] drop_path_rate: 0.2 kernel_size: 7 head: _target_: fish_speech.models.vqgan.modules.firefly.HiFiGANGenerator hop_length: 512 upsample_rates: [8, 8, 4, 2, 2] # changed third rate from 2 to 4 for smoother upsampling steps upsample_kernel_sizes: [16, 16, 8, 4, 4] # corresponding kernel sizes updated accordingly resblock_kernel_sizes: [3, 7, 11] resblock_dilation_sizes: [[1, 3, 5], [1, 3, 5], [1, 3, 5]] num_mels: 512 upsample_initial_channel: 512 pre_conv_kernel_size: 13 post_conv_kernel_size: 13 quantizer: _target_: fish_speech.models.vqgan.modules.fsq.DownsampleFiniteScalarQuantize input_dim: 512 n_groups: 8 n_codebooks: 1 levels: [8, 5, 5, 5] downsample_factor: [2, 2] - User
ERROR: Traceback (most recent call last): File "C:\Users\DjZaN\miniconda3\envs\fish-speech\lib\site-packages\kui\asgi\lifespan.py", line 36, in _call await result File "C:\AI\fish-speech\tools\api_server.py", line 83, in initialize_app app.state.model_manager = ModelManager( File "C:\AI\fish-speech\tools\server\model_manager.py", line 53, in init self.load_decoder_model( File "C:\AI\fish-speech\tools\server\model_manager.py", line 102, in load_decoder_model self.decoder_model = load_decoder_model( File "C:\AI\fish-speech\fish_speech\models\vqgan\inference.py", line 42, in load_model result = model.load_state_dict(state_dict, strict=False, assign=True) File "C:\Users\DjZaN\miniconda3\envs\fish-speech\lib\site-packages\torch\nn\modules\module.py", line 2215, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for FireflyArchitecture: ERROR: size mismatch for head.ups.2.conv.parametrizations.weight.originall: copying a param with shape torch.Size([128, 64, 4]) from checkpoint, the shape in current model is torch.Size([128, 64, 8]). Application startup failed. Exiting.
- Assistant
- User
give me better config the best your entire ai can think of for this btw its text to speech ai
- Assistant
- User
ERROR: Traceback (most recent call last): File "C:\Users\DjZaN\miniconda3\envs\fish-speech\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 92, in _call_target return target(*args, **kwargs) File "C:\AI\fish-speech\fish_speech\models\vqgan\modules\firefly.py", line 235, in init prod(upsample_rates) == hop_length AssertionError: hop_length must be 1024 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\DjZaN\miniconda3\envs\fish-speech\lib\site-packages\kui\asgi\lifespan.py", line 36, in call await result File "C:\AI\fish-speech\tools\api_server.py", line 83, in initialize_app app.state.model_manager = ModelManager( File "C:\AI\fish-speech\tools\server\model_manager.py", line 53, in self.load_decoder_model( File "C:\AI\fish-speech\tools\server\model_manager.py", line 102, in load_decoder_model self.decoder_model = load_decoder_model( File "C:\AI\fish-speech\fish_speech\models\vqgan\inference.py", line 28, in load_model model = instantiate(cfg) File "C:\Users\DjZaN\miniconda3\envs\fish-speech\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 226, in instantiate return instantiate_node( File "C:\Users\DjZaN\miniconda3\envs\fish-speech\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 342, in instantiate_node value = instantiate_node( File "C:\Users\DjZaN\miniconda3\envs\fish-speech\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 347, in instantiate_node return _call_target(, partial, args, kwargs, full_key) File "C:\Users\DjZaN\miniconda3/envs\fish-speech\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 97, in _call_target raise InstantiationException (msg) from e hydra.errors. InstantiationException: Error in call to target 'fish_speech.models.vqgan.modules.firefly.HiFiGANGenerator': AssertionError('hop_length must be 1024') full_key: head ERROR: Application startup failed. Exiting. try again chatgpt
- Assistant
- User
- Assistant