小编Als*_*Als的帖子

FastAPI 应用程序在本地运行,但不在 Docker 容器中运行

我有一个 FastAPI 应用程序,在本地运行时按预期工作,但是,当我尝试在 Docker 容器中运行时,出现“内部服务器错误”。这是我的应用程序的代码:

from fastapi import FastAPI
from pydantic import BaseModel
import pandas as pd
from fbprophet import Prophet

class Data(BaseModel):
    length: int
    ds: list
    y: list
    model: str
    changepoint: float = 0.5
    daily: bool = False
    weekly: bool = False
    annual: bool = False
    upper: float = None
    lower: float = 0.0
    national_holidays: str = None

app = FastAPI()

@app.post("/predict/")
async def create_item(data: Data):

    # Create df from base model
    df = pd.DataFrame(list(zip(data.ds, data.y)), columns =['ds', 'y']) …
Run Code Online (Sandbox Code Playgroud)

python docker facebook-prophet fastapi

9
推荐指数
3
解决办法
1万
查看次数

宽度:50%未按预期工作

我试图让每个部分的屏幕宽度为50%,但优惠券代码部分不起作用.我不确定它是我的HTML还是CSS?刚编辑添加我的其余HTML!

例:

HTML

<div class="CartCode cf">
    <div class="CouponCode">
            <h3>Coupon Code</h3>

        <script type="text/javascript">
            lang.EnterCouponCode = "Please enter your coupon code.";
        </script>
        <form onsubmit="return Cart.CheckCouponCode()" action="http://www.glyndebourneshop.com/cart.php" method="post">
            <input type="hidden" name="action" value="applycoupon">
            <div class="CouponCode">
                <p>To pay for this order using a gift certificate, enter the gift certificate code in the box below and click 'Go'.</p>
                <input type="text" name="couponcode" id="couponcode" class="Textbox Field100">
                <input type="submit" value="Go" class="btn">
            </div>
        </form>
    </div>
    <div class="GiftCertificate">
            <h3>Redeem Gift Certificate</h3>

        <script type="text/javascript">
            lang.EnterGiftCertificateCode = "Please enter your gift certificate code."; …
Run Code Online (Sandbox Code Playgroud)

html css

1
推荐指数
1
解决办法
365
查看次数

标签 统计

css ×1

docker ×1

facebook-prophet ×1

fastapi ×1

html ×1

python ×1