Invalid syntax error

Can anyone help me with this syntax error?

o = block(o, params, f’{base}.block{i}’, mode, stride if i == 0 else 1)

SyntaxError: invalid syntax for f’{base}.block{i}

The complete code is

def block(x, params, base, mode, stride):
o1 = F.relu(utils.batch_norm(x, params, base + ‘.bn0’, mode), inplace=True)
y = F.conv2d(o1, params[base + ‘.conv0’], stride=stride, padding=1)
o2 = F.relu(utils.batch_norm(y, params, base + ‘.bn1’, mode), inplace=True)
z = F.conv2d(o2, params[base + ‘.conv1’], stride=1, padding=1)
if base + ‘.convdim’ in params:
return z + F.conv2d(o1, params[base + ‘.convdim’], stride=stride)
return z + x

def group(o, params, base, mode, stride):
    for i in range(n):
        o = block(o, params, f'{base}.block{i}', mode, stride if i == 0 else 1)
    return o